diff --git a/.obsidian/app.json b/.obsidian/app.json deleted file mode 100644 index 286a136..0000000 --- a/.obsidian/app.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "legacyEditor": false, - "livePreview": true, - "promptDelete": false, - "alwaysUpdateLinks": true -} \ No newline at end of file diff --git a/.obsidian/appearance.json b/.obsidian/appearance.json deleted file mode 100644 index 6a84a9a..0000000 --- a/.obsidian/appearance.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "baseFontSize": 16, - "translucency": false -} \ No newline at end of file diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json deleted file mode 100644 index d3f66fa..0000000 --- a/.obsidian/community-plugins.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "obsidian-git" -] \ No newline at end of file diff --git a/.obsidian/core-plugins.json b/.obsidian/core-plugins.json deleted file mode 100644 index ab1d511..0000000 --- a/.obsidian/core-plugins.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - "file-explorer", - "global-search", - "switcher", - "graph", - "backlink", - "page-preview", - "note-composer", - "command-palette", - "editor-status", - "markdown-importer", - "word-count", - "open-with-default-app", - "file-recovery" -] \ No newline at end of file diff --git a/.obsidian/graph.json b/.obsidian/graph.json deleted file mode 100644 index e21a18d..0000000 --- a/.obsidian/graph.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "collapse-filter": true, - "search": "", - "showTags": false, - "showAttachments": false, - "hideUnresolved": false, - "showOrphans": true, - "collapse-color-groups": true, - "colorGroups": [], - "collapse-display": true, - "showArrow": false, - "textFadeMultiplier": 0, - "nodeSizeMultiplier": 1, - "lineSizeMultiplier": 1, - "collapse-forces": true, - "centerStrength": 0.518713248970312, - "repelStrength": 10, - "linkStrength": 1, - "linkDistance": 250, - "scale": 1, - "close": false -} \ No newline at end of file diff --git a/.obsidian/hotkeys.json b/.obsidian/hotkeys.json deleted file mode 100644 index 9e26dfe..0000000 --- a/.obsidian/hotkeys.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-git/data.json b/.obsidian/plugins/obsidian-git/data.json deleted file mode 100644 index c6225b3..0000000 --- a/.obsidian/plugins/obsidian-git/data.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "commitMessage": "vault backup: {{date}}", - "autoCommitMessage": "vault backup: {{date}}", - "commitDateFormat": "YYYY-MM-DD HH:mm:ss", - "autoSaveInterval": 5, - "autoPullInterval": 0, - "autoPullOnBoot": false, - "disablePush": false, - "pullBeforePush": true, - "disablePopups": false, - "listChangedFilesInMessageBody": false, - "showStatusBar": true, - "updateSubmodules": false, - "syncMethod": "merge", - "gitPath": "", - "customMessageOnAutoBackup": false, - "autoBackupAfterFileChange": false, - "treeStructure": false, - "refreshSourceControl": true -} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-git/main.js b/.obsidian/plugins/obsidian-git/main.js deleted file mode 100644 index 50a3125..0000000 --- a/.obsidian/plugins/obsidian-git/main.js +++ /dev/null @@ -1,15087 +0,0 @@ -/* -THIS IS A GENERATED/BUNDLED FILE BY ESBUILD -if you want to view the source visit the plugins github repository (https://github.com/phibr0/obsidian-dictionary) -*/ - -var __create = Object.create; -var __defProp = Object.defineProperty; -var __defProps = Object.defineProperties; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropDescs = Object.getOwnPropertyDescriptors; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getOwnPropSymbols = Object.getOwnPropertySymbols; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __propIsEnum = Object.prototype.propertyIsEnumerable; -var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value; -var __spreadValues = (a, b) => { - for (var prop in b || (b = {})) - if (__hasOwnProp.call(b, prop)) - __defNormalProp(a, prop, b[prop]); - if (__getOwnPropSymbols) - for (var prop of __getOwnPropSymbols(b)) { - if (__propIsEnum.call(b, prop)) - __defNormalProp(a, prop, b[prop]); - } - return a; -}; -var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); -var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - __markAsModule(target); - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __reExport = (target, module2, desc) => { - if (module2 && typeof module2 === "object" || typeof module2 === "function") { - for (let key2 of __getOwnPropNames(module2)) - if (!__hasOwnProp.call(target, key2) && key2 !== "default") - __defProp(target, key2, { get: () => module2[key2], enumerable: !(desc = __getOwnPropDesc(module2, key2)) || desc.enumerable }); - } - return target; -}; -var __toModule = (module2) => { - return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); -}; -var __async = (__this, __arguments, generator) => { - return new Promise((resolve, reject) => { - var fulfilled = (value) => { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - }; - var rejected = (value) => { - try { - step(generator.throw(value)); - } catch (e) { - reject(e); - } - }; - var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); - step((generator = generator.apply(__this, __arguments)).next()); - }); -}; - -// node_modules/simple-git/src/lib/errors/git-error.js -var require_git_error = __commonJS({ - "node_modules/simple-git/src/lib/errors/git-error.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GitError = void 0; - var GitError = class extends Error { - constructor(task, message) { - super(message); - this.task = task; - Object.setPrototypeOf(this, new.target.prototype); - } - }; - exports.GitError = GitError; - } -}); - -// node_modules/simple-git/src/lib/errors/git-response-error.js -var require_git_response_error = __commonJS({ - "node_modules/simple-git/src/lib/errors/git-response-error.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GitResponseError = void 0; - var git_error_1 = require_git_error(); - var GitResponseError = class extends git_error_1.GitError { - constructor(git, message) { - super(void 0, message || String(git)); - this.git = git; - } - }; - exports.GitResponseError = GitResponseError; - } -}); - -// node_modules/simple-git/src/lib/errors/git-construct-error.js -var require_git_construct_error = __commonJS({ - "node_modules/simple-git/src/lib/errors/git-construct-error.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GitConstructError = void 0; - var git_error_1 = require_git_error(); - var GitConstructError = class extends git_error_1.GitError { - constructor(config, message) { - super(void 0, message); - this.config = config; - } - }; - exports.GitConstructError = GitConstructError; - } -}); - -// node_modules/simple-git/src/lib/errors/git-plugin-error.js -var require_git_plugin_error = __commonJS({ - "node_modules/simple-git/src/lib/errors/git-plugin-error.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GitPluginError = void 0; - var git_error_1 = require_git_error(); - var GitPluginError = class extends git_error_1.GitError { - constructor(task, plugin, message) { - super(task, message); - this.task = task; - this.plugin = plugin; - Object.setPrototypeOf(this, new.target.prototype); - } - }; - exports.GitPluginError = GitPluginError; - } -}); - -// node_modules/simple-git/src/lib/errors/task-configuration-error.js -var require_task_configuration_error = __commonJS({ - "node_modules/simple-git/src/lib/errors/task-configuration-error.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.TaskConfigurationError = void 0; - var git_error_1 = require_git_error(); - var TaskConfigurationError = class extends git_error_1.GitError { - constructor(message) { - super(void 0, message); - } - }; - exports.TaskConfigurationError = TaskConfigurationError; - } -}); - -// node_modules/ms/index.js -var require_ms = __commonJS({ - "node_modules/ms/index.js"(exports, module2) { - var s = 1e3; - var m = s * 60; - var h = m * 60; - var d = h * 24; - var w = d * 7; - var y = d * 365.25; - module2.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === "string" && val.length > 0) { - return parse(val); - } else if (type === "number" && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val)); - }; - function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || "ms").toLowerCase(); - switch (type) { - case "years": - case "year": - case "yrs": - case "yr": - case "y": - return n * y; - case "weeks": - case "week": - case "w": - return n * w; - case "days": - case "day": - case "d": - return n * d; - case "hours": - case "hour": - case "hrs": - case "hr": - case "h": - return n * h; - case "minutes": - case "minute": - case "mins": - case "min": - case "m": - return n * m; - case "seconds": - case "second": - case "secs": - case "sec": - case "s": - return n * s; - case "milliseconds": - case "millisecond": - case "msecs": - case "msec": - case "ms": - return n; - default: - return void 0; - } - } - function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + "d"; - } - if (msAbs >= h) { - return Math.round(ms / h) + "h"; - } - if (msAbs >= m) { - return Math.round(ms / m) + "m"; - } - if (msAbs >= s) { - return Math.round(ms / s) + "s"; - } - return ms + "ms"; - } - function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, "day"); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, "hour"); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, "minute"); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, "second"); - } - return ms + " ms"; - } - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); - } - } -}); - -// node_modules/debug/src/common.js -var require_common = __commonJS({ - "node_modules/debug/src/common.js"(exports, module2) { - function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require_ms(); - createDebug.destroy = destroy; - Object.keys(env).forEach((key2) => { - createDebug[key2] = env[key2]; - }); - createDebug.names = []; - createDebug.skips = []; - createDebug.formatters = {}; - function selectColor(namespace) { - let hash2 = 0; - for (let i = 0; i < namespace.length; i++) { - hash2 = (hash2 << 5) - hash2 + namespace.charCodeAt(i); - hash2 |= 0; - } - return createDebug.colors[Math.abs(hash2) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug(...args) { - if (!debug.enabled) { - return; - } - const self2 = debug; - const curr = Number(new Date()); - const ms = curr - (prevTime || curr); - self2.diff = ms; - self2.prev = prevTime; - self2.curr = curr; - prevTime = curr; - args[0] = createDebug.coerce(args[0]); - if (typeof args[0] !== "string") { - args.unshift("%O"); - } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val = args[index]; - match = formatter.call(self2, val); - args.splice(index, 1); - index--; - } - return match; - }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); - } - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend; - debug.destroy = createDebug.destroy; - Object.defineProperty(debug, "enabled", { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - return enabledCache; - }, - set: (v) => { - enableOverride = v; - } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug); - } - return debug; - } - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - createDebug.names = []; - createDebug.skips = []; - let i; - const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/); - const len = split.length; - for (i = 0; i < len; i++) { - if (!split[i]) { - continue; - } - namespaces = split[i].replace(/\*/g, ".*?"); - if (namespaces[0] === "-") { - createDebug.skips.push(new RegExp("^" + namespaces.substr(1) + "$")); - } else { - createDebug.names.push(new RegExp("^" + namespaces + "$")); - } - } - } - function disable() { - const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace) - ].join(","); - createDebug.enable(""); - return namespaces; - } - function enabled(name) { - if (name[name.length - 1] === "*") { - return true; - } - let i; - let len; - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { - return false; - } - } - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { - return true; - } - } - return false; - } - function toNamespace(regexp) { - return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*"); - } - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - function destroy() { - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - createDebug.enable(createDebug.load()); - return createDebug; - } - module2.exports = setup; - } -}); - -// node_modules/debug/src/browser.js -var require_browser = __commonJS({ - "node_modules/debug/src/browser.js"(exports, module2) { - exports.formatArgs = formatArgs; - exports.save = save; - exports.load = load; - exports.useColors = useColors; - exports.storage = localstorage(); - exports.destroy = (() => { - let warned = false; - return () => { - if (!warned) { - warned = true; - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - }; - })(); - exports.colors = [ - "#0000CC", - "#0000FF", - "#0033CC", - "#0033FF", - "#0066CC", - "#0066FF", - "#0099CC", - "#0099FF", - "#00CC00", - "#00CC33", - "#00CC66", - "#00CC99", - "#00CCCC", - "#00CCFF", - "#3300CC", - "#3300FF", - "#3333CC", - "#3333FF", - "#3366CC", - "#3366FF", - "#3399CC", - "#3399FF", - "#33CC00", - "#33CC33", - "#33CC66", - "#33CC99", - "#33CCCC", - "#33CCFF", - "#6600CC", - "#6600FF", - "#6633CC", - "#6633FF", - "#66CC00", - "#66CC33", - "#9900CC", - "#9900FF", - "#9933CC", - "#9933FF", - "#99CC00", - "#99CC33", - "#CC0000", - "#CC0033", - "#CC0066", - "#CC0099", - "#CC00CC", - "#CC00FF", - "#CC3300", - "#CC3333", - "#CC3366", - "#CC3399", - "#CC33CC", - "#CC33FF", - "#CC6600", - "#CC6633", - "#CC9900", - "#CC9933", - "#CCCC00", - "#CCCC33", - "#FF0000", - "#FF0033", - "#FF0066", - "#FF0099", - "#FF00CC", - "#FF00FF", - "#FF3300", - "#FF3333", - "#FF3366", - "#FF3399", - "#FF33CC", - "#FF33FF", - "#FF6600", - "#FF6633", - "#FF9900", - "#FF9933", - "#FFCC00", - "#FFCC33" - ]; - function useColors() { - if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { - return true; - } - if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); - } - function formatArgs(args) { - args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); - if (!this.useColors) { - return; - } - const c = "color: " + this.color; - args.splice(1, 0, c, "color: inherit"); - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } - }); - args.splice(lastC, 0, c); - } - exports.log = console.debug || console.log || (() => { - }); - function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem("debug", namespaces); - } else { - exports.storage.removeItem("debug"); - } - } catch (error) { - } - } - function load() { - let r; - try { - r = exports.storage.getItem("debug"); - } catch (error) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; - } - return r; - } - function localstorage() { - try { - return localStorage; - } catch (error) { - } - } - module2.exports = require_common()(exports); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error) { - return "[UnexpectedJSONParseError]: " + error.message; - } - }; - } -}); - -// node_modules/has-flag/index.js -var require_has_flag = __commonJS({ - "node_modules/has-flag/index.js"(exports, module2) { - "use strict"; - module2.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf("--"); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); - }; - } -}); - -// node_modules/supports-color/index.js -var require_supports_color = __commonJS({ - "node_modules/supports-color/index.js"(exports, module2) { - "use strict"; - var os = require("os"); - var tty = require("tty"); - var hasFlag = require_has_flag(); - var { env } = process; - var forceColor; - if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { - forceColor = 0; - } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { - forceColor = 1; - } - if ("FORCE_COLOR" in env) { - if (env.FORCE_COLOR === "true") { - forceColor = 1; - } else if (env.FORCE_COLOR === "false") { - forceColor = 0; - } else { - forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); - } - } - function translateLevel(level) { - if (level === 0) { - return false; - } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; - } - function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; - } - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { - return 3; - } - if (hasFlag("color=256")) { - return 2; - } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; - } - const min = forceColor || 0; - if (env.TERM === "dumb") { - return min; - } - if (process.platform === "win32") { - const osRelease = os.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - return 1; - } - if ("CI" in env) { - if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { - return 1; - } - return min; - } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - if (env.COLORTERM === "truecolor") { - return 3; - } - if ("TERM_PROGRAM" in env) { - const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env.TERM_PROGRAM) { - case "iTerm.app": - return version >= 3 ? 3 : 2; - case "Apple_Terminal": - return 2; - } - } - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - if ("COLORTERM" in env) { - return 1; - } - return min; - } - function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); - return translateLevel(level); - } - module2.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) - }; - } -}); - -// node_modules/debug/src/node.js -var require_node = __commonJS({ - "node_modules/debug/src/node.js"(exports, module2) { - var tty = require("tty"); - var util = require("util"); - exports.init = init2; - exports.log = log; - exports.formatArgs = formatArgs; - exports.save = save; - exports.load = load; - exports.useColors = useColors; - exports.destroy = util.deprecate(() => { - }, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - exports.colors = [6, 2, 3, 4, 5, 1]; - try { - const supportsColor = require_supports_color(); - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } - } catch (error) { - } - exports.inspectOpts = Object.keys(process.env).filter((key2) => { - return /^debug_/i.test(key2); - }).reduce((obj, key2) => { - const prop = key2.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); - let val = process.env[key2]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === "null") { - val = null; - } else { - val = Number(val); - } - obj[prop] = val; - return obj; - }, {}); - function useColors() { - return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); - } - function formatArgs(args) { - const { namespace: name, useColors: useColors2 } = this; - if (useColors2) { - const c = this.color; - const colorCode = "[3" + (c < 8 ? c : "8;5;" + c); - const prefix = ` ${colorCode};1m${name} `; - args[0] = prefix + args[0].split("\n").join("\n" + prefix); - args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + ""); - } else { - args[0] = getDate() + name + " " + args[0]; - } - } - function getDate() { - if (exports.inspectOpts.hideDate) { - return ""; - } - return new Date().toISOString() + " "; - } - function log(...args) { - return process.stderr.write(util.format(...args) + "\n"); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; - } - } - function load() { - return process.env.DEBUG; - } - function init2(debug) { - debug.inspectOpts = {}; - const keys = Object.keys(exports.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } - } - module2.exports = require_common()(exports); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); - }; - } -}); - -// node_modules/debug/src/index.js -var require_src = __commonJS({ - "node_modules/debug/src/index.js"(exports, module2) { - if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) { - module2.exports = require_browser(); - } else { - module2.exports = require_node(); - } - } -}); - -// node_modules/@kwsites/file-exists/dist/src/index.js -var require_src2 = __commonJS({ - "node_modules/@kwsites/file-exists/dist/src/index.js"(exports) { - "use strict"; - var __importDefault2 = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - var fs_1 = require("fs"); - var debug_1 = __importDefault2(require_src()); - var log = debug_1.default("@kwsites/file-exists"); - function check(path3, isFile, isDirectory) { - log(`checking %s`, path3); - try { - const stat = fs_1.statSync(path3); - if (stat.isFile() && isFile) { - log(`[OK] path represents a file`); - return true; - } - if (stat.isDirectory() && isDirectory) { - log(`[OK] path represents a directory`); - return true; - } - log(`[FAIL] path represents something other than a file or directory`); - return false; - } catch (e) { - if (e.code === "ENOENT") { - log(`[FAIL] path is not accessible: %o`, e); - return false; - } - log(`[FATAL] %o`, e); - throw e; - } - } - function exists(path3, type = exports.READABLE) { - return check(path3, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0); - } - exports.exists = exists; - exports.FILE = 1; - exports.FOLDER = 2; - exports.READABLE = exports.FILE + exports.FOLDER; - } -}); - -// node_modules/@kwsites/file-exists/dist/index.js -var require_dist = __commonJS({ - "node_modules/@kwsites/file-exists/dist/index.js"(exports) { - "use strict"; - function __export2(m) { - for (var p in m) - if (!exports.hasOwnProperty(p)) - exports[p] = m[p]; - } - Object.defineProperty(exports, "__esModule", { value: true }); - __export2(require_src2()); - } -}); - -// node_modules/simple-git/src/lib/utils/util.js -var require_util = __commonJS({ - "node_modules/simple-git/src/lib/utils/util.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.delay = exports.pick = exports.bufferToString = exports.prefixedArray = exports.asNumber = exports.asStringArray = exports.asArray = exports.objectToString = exports.remove = exports.including = exports.append = exports.folderExists = exports.forEachLineWithContent = exports.toLinesWithContent = exports.last = exports.first = exports.splitOn = exports.isUserFunction = exports.asFunction = exports.NOOP = exports.NULL = void 0; - var file_exists_1 = require_dist(); - exports.NULL = "\0"; - var NOOP = () => { - }; - exports.NOOP = NOOP; - function asFunction(source) { - return typeof source === "function" ? source : exports.NOOP; - } - exports.asFunction = asFunction; - function isUserFunction(source) { - return typeof source === "function" && source !== exports.NOOP; - } - exports.isUserFunction = isUserFunction; - function splitOn(input, char) { - const index = input.indexOf(char); - if (index <= 0) { - return [input, ""]; - } - return [ - input.substr(0, index), - input.substr(index + 1) - ]; - } - exports.splitOn = splitOn; - function first(input, offset = 0) { - return isArrayLike(input) && input.length > offset ? input[offset] : void 0; - } - exports.first = first; - function last(input, offset = 0) { - if (isArrayLike(input) && input.length > offset) { - return input[input.length - 1 - offset]; - } - } - exports.last = last; - function isArrayLike(input) { - return !!(input && typeof input.length === "number"); - } - function toLinesWithContent(input, trimmed = true, separator = "\n") { - return input.split(separator).reduce((output, line) => { - const lineContent = trimmed ? line.trim() : line; - if (lineContent) { - output.push(lineContent); - } - return output; - }, []); - } - exports.toLinesWithContent = toLinesWithContent; - function forEachLineWithContent(input, callback) { - return toLinesWithContent(input, true).map((line) => callback(line)); - } - exports.forEachLineWithContent = forEachLineWithContent; - function folderExists(path3) { - return file_exists_1.exists(path3, file_exists_1.FOLDER); - } - exports.folderExists = folderExists; - function append2(target, item) { - if (Array.isArray(target)) { - if (!target.includes(item)) { - target.push(item); - } - } else { - target.add(item); - } - return item; - } - exports.append = append2; - function including(target, item) { - if (Array.isArray(target) && !target.includes(item)) { - target.push(item); - } - return target; - } - exports.including = including; - function remove(target, item) { - if (Array.isArray(target)) { - const index = target.indexOf(item); - if (index >= 0) { - target.splice(index, 1); - } - } else { - target.delete(item); - } - return item; - } - exports.remove = remove; - exports.objectToString = Object.prototype.toString.call.bind(Object.prototype.toString); - function asArray(source) { - return Array.isArray(source) ? source : [source]; - } - exports.asArray = asArray; - function asStringArray(source) { - return asArray(source).map(String); - } - exports.asStringArray = asStringArray; - function asNumber(source, onNaN = 0) { - if (source == null) { - return onNaN; - } - const num = parseInt(source, 10); - return isNaN(num) ? onNaN : num; - } - exports.asNumber = asNumber; - function prefixedArray(input, prefix) { - const output = []; - for (let i = 0, max = input.length; i < max; i++) { - output.push(prefix, input[i]); - } - return output; - } - exports.prefixedArray = prefixedArray; - function bufferToString(input) { - return (Array.isArray(input) ? Buffer.concat(input) : input).toString("utf-8"); - } - exports.bufferToString = bufferToString; - function pick(source, properties) { - return Object.assign({}, ...properties.map((property) => property in source ? { [property]: source[property] } : {})); - } - exports.pick = pick; - function delay(duration = 0) { - return new Promise((done) => setTimeout(done, duration)); - } - exports.delay = delay; - } -}); - -// node_modules/simple-git/src/lib/utils/argument-filters.js -var require_argument_filters = __commonJS({ - "node_modules/simple-git/src/lib/utils/argument-filters.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.filterHasLength = exports.filterFunction = exports.filterPlainObject = exports.filterStringOrStringArray = exports.filterStringArray = exports.filterString = exports.filterPrimitives = exports.filterArray = exports.filterType = void 0; - var util_1 = require_util(); - function filterType(input, filter, def) { - if (filter(input)) { - return input; - } - return arguments.length > 2 ? def : void 0; - } - exports.filterType = filterType; - var filterArray = (input) => { - return Array.isArray(input); - }; - exports.filterArray = filterArray; - function filterPrimitives(input, omit) { - return /number|string|boolean/.test(typeof input) && (!omit || !omit.includes(typeof input)); - } - exports.filterPrimitives = filterPrimitives; - var filterString = (input) => { - return typeof input === "string"; - }; - exports.filterString = filterString; - var filterStringArray = (input) => { - return Array.isArray(input) && input.every(exports.filterString); - }; - exports.filterStringArray = filterStringArray; - var filterStringOrStringArray = (input) => { - return exports.filterString(input) || Array.isArray(input) && input.every(exports.filterString); - }; - exports.filterStringOrStringArray = filterStringOrStringArray; - function filterPlainObject(input) { - return !!input && util_1.objectToString(input) === "[object Object]"; - } - exports.filterPlainObject = filterPlainObject; - function filterFunction(input) { - return typeof input === "function"; - } - exports.filterFunction = filterFunction; - var filterHasLength = (input) => { - if (input == null || "number|boolean|function".includes(typeof input)) { - return false; - } - return Array.isArray(input) || typeof input === "string" || typeof input.length === "number"; - }; - exports.filterHasLength = filterHasLength; - } -}); - -// node_modules/simple-git/src/lib/utils/exit-codes.js -var require_exit_codes = __commonJS({ - "node_modules/simple-git/src/lib/utils/exit-codes.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ExitCodes = void 0; - var ExitCodes; - (function(ExitCodes2) { - ExitCodes2[ExitCodes2["SUCCESS"] = 0] = "SUCCESS"; - ExitCodes2[ExitCodes2["ERROR"] = 1] = "ERROR"; - ExitCodes2[ExitCodes2["UNCLEAN"] = 128] = "UNCLEAN"; - })(ExitCodes = exports.ExitCodes || (exports.ExitCodes = {})); - } -}); - -// node_modules/simple-git/src/lib/utils/git-output-streams.js -var require_git_output_streams = __commonJS({ - "node_modules/simple-git/src/lib/utils/git-output-streams.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GitOutputStreams = void 0; - var GitOutputStreams = class { - constructor(stdOut, stdErr) { - this.stdOut = stdOut; - this.stdErr = stdErr; - } - asStrings() { - return new GitOutputStreams(this.stdOut.toString("utf8"), this.stdErr.toString("utf8")); - } - }; - exports.GitOutputStreams = GitOutputStreams; - } -}); - -// node_modules/simple-git/src/lib/utils/line-parser.js -var require_line_parser = __commonJS({ - "node_modules/simple-git/src/lib/utils/line-parser.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RemoteLineParser = exports.LineParser = void 0; - var LineParser = class { - constructor(regExp, useMatches) { - this.matches = []; - this.parse = (line, target) => { - this.resetMatches(); - if (!this._regExp.every((reg, index) => this.addMatch(reg, index, line(index)))) { - return false; - } - return this.useMatches(target, this.prepareMatches()) !== false; - }; - this._regExp = Array.isArray(regExp) ? regExp : [regExp]; - if (useMatches) { - this.useMatches = useMatches; - } - } - useMatches(target, match) { - throw new Error(`LineParser:useMatches not implemented`); - } - resetMatches() { - this.matches.length = 0; - } - prepareMatches() { - return this.matches; - } - addMatch(reg, index, line) { - const matched = line && reg.exec(line); - if (matched) { - this.pushMatch(index, matched); - } - return !!matched; - } - pushMatch(_index, matched) { - this.matches.push(...matched.slice(1)); - } - }; - exports.LineParser = LineParser; - var RemoteLineParser = class extends LineParser { - addMatch(reg, index, line) { - return /^remote:\s/.test(String(line)) && super.addMatch(reg, index, line); - } - pushMatch(index, matched) { - if (index > 0 || matched.length > 1) { - super.pushMatch(index, matched); - } - } - }; - exports.RemoteLineParser = RemoteLineParser; - } -}); - -// node_modules/simple-git/src/lib/utils/simple-git-options.js -var require_simple_git_options = __commonJS({ - "node_modules/simple-git/src/lib/utils/simple-git-options.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createInstanceConfig = void 0; - var defaultOptions = { - binary: "git", - maxConcurrentProcesses: 5, - config: [] - }; - function createInstanceConfig(...options) { - const baseDir = process.cwd(); - const config = Object.assign(Object.assign({ baseDir }, defaultOptions), ...options.filter((o) => typeof o === "object" && o)); - config.baseDir = config.baseDir || baseDir; - return config; - } - exports.createInstanceConfig = createInstanceConfig; - } -}); - -// node_modules/simple-git/src/lib/utils/task-options.js -var require_task_options = __commonJS({ - "node_modules/simple-git/src/lib/utils/task-options.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.trailingFunctionArgument = exports.trailingOptionsArgument = exports.getTrailingOptions = exports.appendTaskOptions = void 0; - var argument_filters_1 = require_argument_filters(); - var util_1 = require_util(); - function appendTaskOptions(options, commands = []) { - if (!argument_filters_1.filterPlainObject(options)) { - return commands; - } - return Object.keys(options).reduce((commands2, key2) => { - const value = options[key2]; - if (argument_filters_1.filterPrimitives(value, ["boolean"])) { - commands2.push(key2 + "=" + value); - } else { - commands2.push(key2); - } - return commands2; - }, commands); - } - exports.appendTaskOptions = appendTaskOptions; - function getTrailingOptions(args, initialPrimitive = 0, objectOnly = false) { - const command = []; - for (let i = 0, max = initialPrimitive < 0 ? args.length : initialPrimitive; i < max; i++) { - if ("string|number".includes(typeof args[i])) { - command.push(String(args[i])); - } - } - appendTaskOptions(trailingOptionsArgument(args), command); - if (!objectOnly) { - command.push(...trailingArrayArgument(args)); - } - return command; - } - exports.getTrailingOptions = getTrailingOptions; - function trailingArrayArgument(args) { - const hasTrailingCallback = typeof util_1.last(args) === "function"; - return argument_filters_1.filterType(util_1.last(args, hasTrailingCallback ? 1 : 0), argument_filters_1.filterArray, []); - } - function trailingOptionsArgument(args) { - const hasTrailingCallback = argument_filters_1.filterFunction(util_1.last(args)); - return argument_filters_1.filterType(util_1.last(args, hasTrailingCallback ? 1 : 0), argument_filters_1.filterPlainObject); - } - exports.trailingOptionsArgument = trailingOptionsArgument; - function trailingFunctionArgument(args, includeNoop = true) { - const callback = util_1.asFunction(util_1.last(args)); - return includeNoop || util_1.isUserFunction(callback) ? callback : void 0; - } - exports.trailingFunctionArgument = trailingFunctionArgument; - } -}); - -// node_modules/simple-git/src/lib/utils/task-parser.js -var require_task_parser = __commonJS({ - "node_modules/simple-git/src/lib/utils/task-parser.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseStringResponse = exports.callTaskParser = void 0; - var util_1 = require_util(); - function callTaskParser(parser, streams) { - return parser(streams.stdOut, streams.stdErr); - } - exports.callTaskParser = callTaskParser; - function parseStringResponse(result, parsers, ...texts) { - texts.forEach((text2) => { - for (let lines = util_1.toLinesWithContent(text2), i = 0, max = lines.length; i < max; i++) { - const line = (offset = 0) => { - if (i + offset >= max) { - return; - } - return lines[i + offset]; - }; - parsers.some(({ parse }) => parse(line, result)); - } - }); - return result; - } - exports.parseStringResponse = parseStringResponse; - } -}); - -// node_modules/simple-git/src/lib/utils/index.js -var require_utils = __commonJS({ - "node_modules/simple-git/src/lib/utils/index.js"(exports) { - "use strict"; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __exportStar2 = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding2(exports2, m, p); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - __exportStar2(require_argument_filters(), exports); - __exportStar2(require_exit_codes(), exports); - __exportStar2(require_git_output_streams(), exports); - __exportStar2(require_line_parser(), exports); - __exportStar2(require_simple_git_options(), exports); - __exportStar2(require_task_options(), exports); - __exportStar2(require_task_parser(), exports); - __exportStar2(require_util(), exports); - } -}); - -// node_modules/simple-git/src/lib/tasks/check-is-repo.js -var require_check_is_repo = __commonJS({ - "node_modules/simple-git/src/lib/tasks/check-is-repo.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.checkIsBareRepoTask = exports.checkIsRepoRootTask = exports.checkIsRepoTask = exports.CheckRepoActions = void 0; - var utils_1 = require_utils(); - var CheckRepoActions; - (function(CheckRepoActions2) { - CheckRepoActions2["BARE"] = "bare"; - CheckRepoActions2["IN_TREE"] = "tree"; - CheckRepoActions2["IS_REPO_ROOT"] = "root"; - })(CheckRepoActions = exports.CheckRepoActions || (exports.CheckRepoActions = {})); - var onError = ({ exitCode }, error, done, fail) => { - if (exitCode === utils_1.ExitCodes.UNCLEAN && isNotRepoMessage(error)) { - return done(Buffer.from("false")); - } - fail(error); - }; - var parser = (text2) => { - return text2.trim() === "true"; - }; - function checkIsRepoTask(action) { - switch (action) { - case CheckRepoActions.BARE: - return checkIsBareRepoTask(); - case CheckRepoActions.IS_REPO_ROOT: - return checkIsRepoRootTask(); - } - const commands = ["rev-parse", "--is-inside-work-tree"]; - return { - commands, - format: "utf-8", - onError, - parser - }; - } - exports.checkIsRepoTask = checkIsRepoTask; - function checkIsRepoRootTask() { - const commands = ["rev-parse", "--git-dir"]; - return { - commands, - format: "utf-8", - onError, - parser(path3) { - return /^\.(git)?$/.test(path3.trim()); - } - }; - } - exports.checkIsRepoRootTask = checkIsRepoRootTask; - function checkIsBareRepoTask() { - const commands = ["rev-parse", "--is-bare-repository"]; - return { - commands, - format: "utf-8", - onError, - parser - }; - } - exports.checkIsBareRepoTask = checkIsBareRepoTask; - function isNotRepoMessage(error) { - return /(Not a git repository|Kein Git-Repository)/i.test(String(error)); - } - } -}); - -// node_modules/simple-git/src/lib/responses/CleanSummary.js -var require_CleanSummary = __commonJS({ - "node_modules/simple-git/src/lib/responses/CleanSummary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.cleanSummaryParser = exports.CleanResponse = void 0; - var utils_1 = require_utils(); - var CleanResponse = class { - constructor(dryRun) { - this.dryRun = dryRun; - this.paths = []; - this.files = []; - this.folders = []; - } - }; - exports.CleanResponse = CleanResponse; - var removalRegexp = /^[a-z]+\s*/i; - var dryRunRemovalRegexp = /^[a-z]+\s+[a-z]+\s*/i; - var isFolderRegexp = /\/$/; - function cleanSummaryParser(dryRun, text2) { - const summary = new CleanResponse(dryRun); - const regexp = dryRun ? dryRunRemovalRegexp : removalRegexp; - utils_1.toLinesWithContent(text2).forEach((line) => { - const removed = line.replace(regexp, ""); - summary.paths.push(removed); - (isFolderRegexp.test(removed) ? summary.folders : summary.files).push(removed); - }); - return summary; - } - exports.cleanSummaryParser = cleanSummaryParser; - } -}); - -// node_modules/simple-git/src/lib/tasks/task.js -var require_task = __commonJS({ - "node_modules/simple-git/src/lib/tasks/task.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isEmptyTask = exports.isBufferTask = exports.straightThroughBufferTask = exports.straightThroughStringTask = exports.configurationErrorTask = exports.adhocExecTask = exports.EMPTY_COMMANDS = void 0; - var task_configuration_error_1 = require_task_configuration_error(); - exports.EMPTY_COMMANDS = []; - function adhocExecTask(parser) { - return { - commands: exports.EMPTY_COMMANDS, - format: "empty", - parser - }; - } - exports.adhocExecTask = adhocExecTask; - function configurationErrorTask(error) { - return { - commands: exports.EMPTY_COMMANDS, - format: "empty", - parser() { - throw typeof error === "string" ? new task_configuration_error_1.TaskConfigurationError(error) : error; - } - }; - } - exports.configurationErrorTask = configurationErrorTask; - function straightThroughStringTask(commands, trimmed = false) { - return { - commands, - format: "utf-8", - parser(text2) { - return trimmed ? String(text2).trim() : text2; - } - }; - } - exports.straightThroughStringTask = straightThroughStringTask; - function straightThroughBufferTask(commands) { - return { - commands, - format: "buffer", - parser(buffer) { - return buffer; - } - }; - } - exports.straightThroughBufferTask = straightThroughBufferTask; - function isBufferTask(task) { - return task.format === "buffer"; - } - exports.isBufferTask = isBufferTask; - function isEmptyTask(task) { - return task.format === "empty" || !task.commands.length; - } - exports.isEmptyTask = isEmptyTask; - } -}); - -// node_modules/simple-git/src/lib/tasks/clean.js -var require_clean = __commonJS({ - "node_modules/simple-git/src/lib/tasks/clean.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isCleanOptionsArray = exports.cleanTask = exports.cleanWithOptionsTask = exports.CleanOptions = exports.CONFIG_ERROR_UNKNOWN_OPTION = exports.CONFIG_ERROR_MODE_REQUIRED = exports.CONFIG_ERROR_INTERACTIVE_MODE = void 0; - var CleanSummary_1 = require_CleanSummary(); - var utils_1 = require_utils(); - var task_1 = require_task(); - exports.CONFIG_ERROR_INTERACTIVE_MODE = "Git clean interactive mode is not supported"; - exports.CONFIG_ERROR_MODE_REQUIRED = 'Git clean mode parameter ("n" or "f") is required'; - exports.CONFIG_ERROR_UNKNOWN_OPTION = "Git clean unknown option found in: "; - var CleanOptions; - (function(CleanOptions2) { - CleanOptions2["DRY_RUN"] = "n"; - CleanOptions2["FORCE"] = "f"; - CleanOptions2["IGNORED_INCLUDED"] = "x"; - CleanOptions2["IGNORED_ONLY"] = "X"; - CleanOptions2["EXCLUDING"] = "e"; - CleanOptions2["QUIET"] = "q"; - CleanOptions2["RECURSIVE"] = "d"; - })(CleanOptions = exports.CleanOptions || (exports.CleanOptions = {})); - var CleanOptionValues = new Set(["i", ...utils_1.asStringArray(Object.values(CleanOptions))]); - function cleanWithOptionsTask(mode, customArgs) { - const { cleanMode, options, valid } = getCleanOptions(mode); - if (!cleanMode) { - return task_1.configurationErrorTask(exports.CONFIG_ERROR_MODE_REQUIRED); - } - if (!valid.options) { - return task_1.configurationErrorTask(exports.CONFIG_ERROR_UNKNOWN_OPTION + JSON.stringify(mode)); - } - options.push(...customArgs); - if (options.some(isInteractiveMode)) { - return task_1.configurationErrorTask(exports.CONFIG_ERROR_INTERACTIVE_MODE); - } - return cleanTask(cleanMode, options); - } - exports.cleanWithOptionsTask = cleanWithOptionsTask; - function cleanTask(mode, customArgs) { - const commands = ["clean", `-${mode}`, ...customArgs]; - return { - commands, - format: "utf-8", - parser(text2) { - return CleanSummary_1.cleanSummaryParser(mode === CleanOptions.DRY_RUN, text2); - } - }; - } - exports.cleanTask = cleanTask; - function isCleanOptionsArray(input) { - return Array.isArray(input) && input.every((test) => CleanOptionValues.has(test)); - } - exports.isCleanOptionsArray = isCleanOptionsArray; - function getCleanOptions(input) { - let cleanMode; - let options = []; - let valid = { cleanMode: false, options: true }; - input.replace(/[^a-z]i/g, "").split("").forEach((char) => { - if (isCleanMode(char)) { - cleanMode = char; - valid.cleanMode = true; - } else { - valid.options = valid.options && isKnownOption(options[options.length] = `-${char}`); - } - }); - return { - cleanMode, - options, - valid - }; - } - function isCleanMode(cleanMode) { - return cleanMode === CleanOptions.FORCE || cleanMode === CleanOptions.DRY_RUN; - } - function isKnownOption(option) { - return /^-[a-z]$/i.test(option) && CleanOptionValues.has(option.charAt(1)); - } - function isInteractiveMode(option) { - if (/^-[^\-]/.test(option)) { - return option.indexOf("i") > 0; - } - return option === "--interactive"; - } - } -}); - -// node_modules/simple-git/src/lib/responses/ConfigList.js -var require_ConfigList = __commonJS({ - "node_modules/simple-git/src/lib/responses/ConfigList.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.configGetParser = exports.configListParser = exports.ConfigList = void 0; - var utils_1 = require_utils(); - var ConfigList = class { - constructor() { - this.files = []; - this.values = Object.create(null); - } - get all() { - if (!this._all) { - this._all = this.files.reduce((all, file) => { - return Object.assign(all, this.values[file]); - }, {}); - } - return this._all; - } - addFile(file) { - if (!(file in this.values)) { - const latest = utils_1.last(this.files); - this.values[file] = latest ? Object.create(this.values[latest]) : {}; - this.files.push(file); - } - return this.values[file]; - } - addValue(file, key2, value) { - const values = this.addFile(file); - if (!values.hasOwnProperty(key2)) { - values[key2] = value; - } else if (Array.isArray(values[key2])) { - values[key2].push(value); - } else { - values[key2] = [values[key2], value]; - } - this._all = void 0; - } - }; - exports.ConfigList = ConfigList; - function configListParser(text2) { - const config = new ConfigList(); - for (const item of configParser(text2)) { - config.addValue(item.file, String(item.key), item.value); - } - return config; - } - exports.configListParser = configListParser; - function configGetParser(text2, key2) { - let value = null; - const values = []; - const scopes = new Map(); - for (const item of configParser(text2, key2)) { - if (item.key !== key2) { - continue; - } - values.push(value = item.value); - if (!scopes.has(item.file)) { - scopes.set(item.file, []); - } - scopes.get(item.file).push(value); - } - return { - key: key2, - paths: Array.from(scopes.keys()), - scopes, - value, - values - }; - } - exports.configGetParser = configGetParser; - function configFilePath(filePath) { - return filePath.replace(/^(file):/, ""); - } - function* configParser(text2, requestedKey = null) { - const lines = text2.split("\0"); - for (let i = 0, max = lines.length - 1; i < max; ) { - const file = configFilePath(lines[i++]); - let value = lines[i++]; - let key2 = requestedKey; - if (value.includes("\n")) { - const line = utils_1.splitOn(value, "\n"); - key2 = line[0]; - value = line[1]; - } - yield { file, key: key2, value }; - } - } - } -}); - -// node_modules/simple-git/src/lib/tasks/config.js -var require_config = __commonJS({ - "node_modules/simple-git/src/lib/tasks/config.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GitConfigScope = void 0; - var ConfigList_1 = require_ConfigList(); - var utils_1 = require_utils(); - var GitConfigScope; - (function(GitConfigScope2) { - GitConfigScope2["system"] = "system"; - GitConfigScope2["global"] = "global"; - GitConfigScope2["local"] = "local"; - GitConfigScope2["worktree"] = "worktree"; - })(GitConfigScope = exports.GitConfigScope || (exports.GitConfigScope = {})); - function asConfigScope(scope, fallback) { - if (typeof scope === "string" && GitConfigScope.hasOwnProperty(scope)) { - return scope; - } - return fallback; - } - function addConfigTask(key2, value, append2, scope) { - const commands = ["config", `--${scope}`]; - if (append2) { - commands.push("--add"); - } - commands.push(key2, value); - return { - commands, - format: "utf-8", - parser(text2) { - return text2; - } - }; - } - function getConfigTask(key2, scope) { - const commands = ["config", "--null", "--show-origin", "--get-all", key2]; - if (scope) { - commands.splice(1, 0, `--${scope}`); - } - return { - commands, - format: "utf-8", - parser(text2) { - return ConfigList_1.configGetParser(text2, key2); - } - }; - } - function listConfigTask(scope) { - const commands = ["config", "--list", "--show-origin", "--null"]; - if (scope) { - commands.push(`--${scope}`); - } - return { - commands, - format: "utf-8", - parser(text2) { - return ConfigList_1.configListParser(text2); - } - }; - } - function default_1() { - return { - addConfig(key2, value, ...rest) { - return this._runTask(addConfigTask(key2, value, rest[0] === true, asConfigScope(rest[1], GitConfigScope.local)), utils_1.trailingFunctionArgument(arguments)); - }, - getConfig(key2, scope) { - return this._runTask(getConfigTask(key2, asConfigScope(scope, void 0)), utils_1.trailingFunctionArgument(arguments)); - }, - listConfig(...rest) { - return this._runTask(listConfigTask(asConfigScope(rest[0], void 0)), utils_1.trailingFunctionArgument(arguments)); - } - }; - } - exports.default = default_1; - } -}); - -// node_modules/simple-git/src/lib/tasks/grep.js -var require_grep = __commonJS({ - "node_modules/simple-git/src/lib/tasks/grep.js"(exports) { - "use strict"; - var _a; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.grepQueryBuilder = void 0; - var utils_1 = require_utils(); - var task_1 = require_task(); - var disallowedOptions = ["-h"]; - var Query = Symbol("grepQuery"); - var GrepQuery = class { - constructor() { - this[_a] = []; - } - *[(_a = Query, Symbol.iterator)]() { - for (const query of this[Query]) { - yield query; - } - } - and(...and) { - and.length && this[Query].push("--and", "(", ...utils_1.prefixedArray(and, "-e"), ")"); - return this; - } - param(...param) { - this[Query].push(...utils_1.prefixedArray(param, "-e")); - return this; - } - }; - function grepQueryBuilder(...params) { - return new GrepQuery().param(...params); - } - exports.grepQueryBuilder = grepQueryBuilder; - function parseGrep(grep) { - const paths = new Set(); - const results = {}; - utils_1.forEachLineWithContent(grep, (input) => { - const [path3, line, preview] = input.split(utils_1.NULL); - paths.add(path3); - (results[path3] = results[path3] || []).push({ - line: utils_1.asNumber(line), - path: path3, - preview - }); - }); - return { - paths, - results - }; - } - function default_1() { - return { - grep(searchTerm) { - const then = utils_1.trailingFunctionArgument(arguments); - const options = utils_1.getTrailingOptions(arguments); - for (const option of disallowedOptions) { - if (options.includes(option)) { - return this._runTask(task_1.configurationErrorTask(`git.grep: use of "${option}" is not supported.`), then); - } - } - if (typeof searchTerm === "string") { - searchTerm = grepQueryBuilder().param(searchTerm); - } - const commands = ["grep", "--null", "-n", "--full-name", ...options, ...searchTerm]; - return this._runTask({ - commands, - format: "utf-8", - parser(stdOut) { - return parseGrep(stdOut); - } - }, then); - } - }; - } - exports.default = default_1; - } -}); - -// node_modules/simple-git/src/lib/tasks/reset.js -var require_reset = __commonJS({ - "node_modules/simple-git/src/lib/tasks/reset.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getResetMode = exports.resetTask = exports.ResetMode = void 0; - var task_1 = require_task(); - var ResetMode; - (function(ResetMode2) { - ResetMode2["MIXED"] = "mixed"; - ResetMode2["SOFT"] = "soft"; - ResetMode2["HARD"] = "hard"; - ResetMode2["MERGE"] = "merge"; - ResetMode2["KEEP"] = "keep"; - })(ResetMode = exports.ResetMode || (exports.ResetMode = {})); - var ResetModes = Array.from(Object.values(ResetMode)); - function resetTask(mode, customArgs) { - const commands = ["reset"]; - if (isValidResetMode(mode)) { - commands.push(`--${mode}`); - } - commands.push(...customArgs); - return task_1.straightThroughStringTask(commands); - } - exports.resetTask = resetTask; - function getResetMode(mode) { - if (isValidResetMode(mode)) { - return mode; - } - switch (typeof mode) { - case "string": - case "undefined": - return ResetMode.SOFT; - } - return; - } - exports.getResetMode = getResetMode; - function isValidResetMode(mode) { - return ResetModes.includes(mode); - } - } -}); - -// node_modules/simple-git/src/lib/api.js -var require_api = __commonJS({ - "node_modules/simple-git/src/lib/api.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var git_construct_error_1 = require_git_construct_error(); - var git_error_1 = require_git_error(); - var git_plugin_error_1 = require_git_plugin_error(); - var git_response_error_1 = require_git_response_error(); - var task_configuration_error_1 = require_task_configuration_error(); - var check_is_repo_1 = require_check_is_repo(); - var clean_1 = require_clean(); - var config_1 = require_config(); - var grep_1 = require_grep(); - var reset_1 = require_reset(); - var api = { - CheckRepoActions: check_is_repo_1.CheckRepoActions, - CleanOptions: clean_1.CleanOptions, - GitConfigScope: config_1.GitConfigScope, - GitConstructError: git_construct_error_1.GitConstructError, - GitError: git_error_1.GitError, - GitPluginError: git_plugin_error_1.GitPluginError, - GitResponseError: git_response_error_1.GitResponseError, - ResetMode: reset_1.ResetMode, - TaskConfigurationError: task_configuration_error_1.TaskConfigurationError, - grepQueryBuilder: grep_1.grepQueryBuilder - }; - exports.default = api; - } -}); - -// node_modules/simple-git/src/lib/plugins/command-config-prefixing-plugin.js -var require_command_config_prefixing_plugin = __commonJS({ - "node_modules/simple-git/src/lib/plugins/command-config-prefixing-plugin.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.commandConfigPrefixingPlugin = void 0; - var utils_1 = require_utils(); - function commandConfigPrefixingPlugin(configuration) { - const prefix = utils_1.prefixedArray(configuration, "-c"); - return { - type: "spawn.args", - action(data) { - return [...prefix, ...data]; - } - }; - } - exports.commandConfigPrefixingPlugin = commandConfigPrefixingPlugin; - } -}); - -// node_modules/@kwsites/promise-deferred/dist/index.js -var require_dist2 = __commonJS({ - "node_modules/@kwsites/promise-deferred/dist/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createDeferred = exports.deferred = void 0; - function deferred() { - let done; - let fail; - let status = "pending"; - const promise2 = new Promise((_done, _fail) => { - done = _done; - fail = _fail; - }); - return { - promise: promise2, - done(result) { - if (status === "pending") { - status = "resolved"; - done(result); - } - }, - fail(error) { - if (status === "pending") { - status = "rejected"; - fail(error); - } - }, - get fulfilled() { - return status !== "pending"; - }, - get status() { - return status; - } - }; - } - exports.deferred = deferred; - exports.createDeferred = deferred; - exports.default = deferred; - } -}); - -// node_modules/simple-git/src/lib/plugins/completion-detection.plugin.js -var require_completion_detection_plugin = __commonJS({ - "node_modules/simple-git/src/lib/plugins/completion-detection.plugin.js"(exports) { - "use strict"; - var __awaiter2 = exports && exports.__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()); - }); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.completionDetectionPlugin = void 0; - var promise_deferred_1 = require_dist2(); - var utils_1 = require_utils(); - var never = promise_deferred_1.default().promise; - function completionDetectionPlugin({ onClose = true, onExit = 50 } = {}) { - function createEvents() { - let exitCode = -1; - const events = { - close: promise_deferred_1.default(), - closeTimeout: promise_deferred_1.default(), - exit: promise_deferred_1.default(), - exitTimeout: promise_deferred_1.default() - }; - const result = Promise.race([ - onClose === false ? never : events.closeTimeout.promise, - onExit === false ? never : events.exitTimeout.promise - ]); - configureTimeout(onClose, events.close, events.closeTimeout); - configureTimeout(onExit, events.exit, events.exitTimeout); - return { - close(code) { - exitCode = code; - events.close.done(); - }, - exit(code) { - exitCode = code; - events.exit.done(); - }, - get exitCode() { - return exitCode; - }, - result - }; - } - function configureTimeout(flag, event, timeout) { - if (flag === false) { - return; - } - (flag === true ? event.promise : event.promise.then(() => utils_1.delay(flag))).then(timeout.done); - } - return { - type: "spawn.after", - action(_data, { spawned, close }) { - var _a, _b; - return __awaiter2(this, void 0, void 0, function* () { - const events = createEvents(); - let deferClose = true; - let quickClose = () => void (deferClose = false); - (_a = spawned.stdout) === null || _a === void 0 ? void 0 : _a.on("data", quickClose); - (_b = spawned.stderr) === null || _b === void 0 ? void 0 : _b.on("data", quickClose); - spawned.on("error", quickClose); - spawned.on("close", (code) => events.close(code)); - spawned.on("exit", (code) => events.exit(code)); - try { - yield events.result; - if (deferClose) { - yield utils_1.delay(50); - } - close(events.exitCode); - } catch (err) { - close(events.exitCode, err); - } - }); - } - }; - } - exports.completionDetectionPlugin = completionDetectionPlugin; - } -}); - -// node_modules/simple-git/src/lib/plugins/error-detection.plugin.js -var require_error_detection_plugin = __commonJS({ - "node_modules/simple-git/src/lib/plugins/error-detection.plugin.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.errorDetectionPlugin = exports.errorDetectionHandler = void 0; - var git_error_1 = require_git_error(); - function isTaskError(result) { - return !!(result.exitCode && result.stdErr.length); - } - function getErrorMessage(result) { - return Buffer.concat([...result.stdOut, ...result.stdErr]); - } - function errorDetectionHandler(overwrite = false, isError = isTaskError, errorMessage = getErrorMessage) { - return (error, result) => { - if (!overwrite && error || !isError(result)) { - return error; - } - return errorMessage(result); - }; - } - exports.errorDetectionHandler = errorDetectionHandler; - function errorDetectionPlugin(config) { - return { - type: "task.error", - action(data, context) { - const error = config(data.error, { - stdErr: context.stdErr, - stdOut: context.stdOut, - exitCode: context.exitCode - }); - if (Buffer.isBuffer(error)) { - return { error: new git_error_1.GitError(void 0, error.toString("utf-8")) }; - } - return { - error - }; - } - }; - } - exports.errorDetectionPlugin = errorDetectionPlugin; - } -}); - -// node_modules/simple-git/src/lib/plugins/plugin-store.js -var require_plugin_store = __commonJS({ - "node_modules/simple-git/src/lib/plugins/plugin-store.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.PluginStore = void 0; - var utils_1 = require_utils(); - var PluginStore = class { - constructor() { - this.plugins = new Set(); - } - add(plugin) { - const plugins = []; - utils_1.asArray(plugin).forEach((plugin2) => plugin2 && this.plugins.add(utils_1.append(plugins, plugin2))); - return () => { - plugins.forEach((plugin2) => this.plugins.delete(plugin2)); - }; - } - exec(type, data, context) { - let output = data; - const contextual = Object.freeze(Object.create(context)); - for (const plugin of this.plugins) { - if (plugin.type === type) { - output = plugin.action(output, contextual); - } - } - return output; - } - }; - exports.PluginStore = PluginStore; - } -}); - -// node_modules/simple-git/src/lib/plugins/progress-monitor-plugin.js -var require_progress_monitor_plugin = __commonJS({ - "node_modules/simple-git/src/lib/plugins/progress-monitor-plugin.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.progressMonitorPlugin = void 0; - var utils_1 = require_utils(); - function progressMonitorPlugin(progress) { - const progressCommand = "--progress"; - const progressMethods = ["checkout", "clone", "fetch", "pull", "push"]; - const onProgress = { - type: "spawn.after", - action(_data, context) { - var _a; - if (!context.commands.includes(progressCommand)) { - return; - } - (_a = context.spawned.stderr) === null || _a === void 0 ? void 0 : _a.on("data", (chunk) => { - const message = /^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(chunk.toString("utf8")); - if (!message) { - return; - } - progress({ - method: context.method, - stage: progressEventStage(message[1]), - progress: utils_1.asNumber(message[2]), - processed: utils_1.asNumber(message[3]), - total: utils_1.asNumber(message[4]) - }); - }); - } - }; - const onArgs = { - type: "spawn.args", - action(args, context) { - if (!progressMethods.includes(context.method)) { - return args; - } - return utils_1.including(args, progressCommand); - } - }; - return [onArgs, onProgress]; - } - exports.progressMonitorPlugin = progressMonitorPlugin; - function progressEventStage(input) { - return String(input.toLowerCase().split(" ", 1)) || "unknown"; - } - } -}); - -// node_modules/simple-git/src/lib/plugins/simple-git-plugin.js -var require_simple_git_plugin = __commonJS({ - "node_modules/simple-git/src/lib/plugins/simple-git-plugin.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - } -}); - -// node_modules/simple-git/src/lib/plugins/spawn-options-plugin.js -var require_spawn_options_plugin = __commonJS({ - "node_modules/simple-git/src/lib/plugins/spawn-options-plugin.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.spawnOptionsPlugin = void 0; - var utils_1 = require_utils(); - function spawnOptionsPlugin(spawnOptions) { - const options = utils_1.pick(spawnOptions, ["uid", "gid"]); - return { - type: "spawn.options", - action(data) { - return Object.assign(Object.assign({}, options), data); - } - }; - } - exports.spawnOptionsPlugin = spawnOptionsPlugin; - } -}); - -// node_modules/simple-git/src/lib/plugins/timout-plugin.js -var require_timout_plugin = __commonJS({ - "node_modules/simple-git/src/lib/plugins/timout-plugin.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.timeoutPlugin = void 0; - var git_plugin_error_1 = require_git_plugin_error(); - function timeoutPlugin({ block }) { - if (block > 0) { - return { - type: "spawn.after", - action(_data, context) { - var _a, _b; - let timeout; - function wait3() { - timeout && clearTimeout(timeout); - timeout = setTimeout(kill, block); - } - function stop() { - var _a2, _b2; - (_a2 = context.spawned.stdout) === null || _a2 === void 0 ? void 0 : _a2.off("data", wait3); - (_b2 = context.spawned.stderr) === null || _b2 === void 0 ? void 0 : _b2.off("data", wait3); - context.spawned.off("exit", stop); - context.spawned.off("close", stop); - } - function kill() { - stop(); - context.kill(new git_plugin_error_1.GitPluginError(void 0, "timeout", `block timeout reached`)); - } - (_a = context.spawned.stdout) === null || _a === void 0 ? void 0 : _a.on("data", wait3); - (_b = context.spawned.stderr) === null || _b === void 0 ? void 0 : _b.on("data", wait3); - context.spawned.on("exit", stop); - context.spawned.on("close", stop); - wait3(); - } - }; - } - } - exports.timeoutPlugin = timeoutPlugin; - } -}); - -// node_modules/simple-git/src/lib/plugins/index.js -var require_plugins = __commonJS({ - "node_modules/simple-git/src/lib/plugins/index.js"(exports) { - "use strict"; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __exportStar2 = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding2(exports2, m, p); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - __exportStar2(require_command_config_prefixing_plugin(), exports); - __exportStar2(require_completion_detection_plugin(), exports); - __exportStar2(require_error_detection_plugin(), exports); - __exportStar2(require_plugin_store(), exports); - __exportStar2(require_progress_monitor_plugin(), exports); - __exportStar2(require_simple_git_plugin(), exports); - __exportStar2(require_spawn_options_plugin(), exports); - __exportStar2(require_timout_plugin(), exports); - } -}); - -// node_modules/simple-git/src/lib/git-logger.js -var require_git_logger = __commonJS({ - "node_modules/simple-git/src/lib/git-logger.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GitLogger = exports.createLogger = void 0; - var debug_1 = require_src(); - var utils_1 = require_utils(); - debug_1.default.formatters.L = (value) => String(utils_1.filterHasLength(value) ? value.length : "-"); - debug_1.default.formatters.B = (value) => { - if (Buffer.isBuffer(value)) { - return value.toString("utf8"); - } - return utils_1.objectToString(value); - }; - function createLog() { - return debug_1.default("simple-git"); - } - function prefixedLogger(to, prefix, forward) { - if (!prefix || !String(prefix).replace(/\s*/, "")) { - return !forward ? to : (message, ...args) => { - to(message, ...args); - forward(message, ...args); - }; - } - return (message, ...args) => { - to(`%s ${message}`, prefix, ...args); - if (forward) { - forward(message, ...args); - } - }; - } - function childLoggerName(name, childDebugger, { namespace: parentNamespace }) { - if (typeof name === "string") { - return name; - } - const childNamespace = childDebugger && childDebugger.namespace || ""; - if (childNamespace.startsWith(parentNamespace)) { - return childNamespace.substr(parentNamespace.length + 1); - } - return childNamespace || parentNamespace; - } - function createLogger(label, verbose, initialStep, infoDebugger = createLog()) { - const labelPrefix = label && `[${label}]` || ""; - const spawned = []; - const debugDebugger = typeof verbose === "string" ? infoDebugger.extend(verbose) : verbose; - const key2 = childLoggerName(utils_1.filterType(verbose, utils_1.filterString), debugDebugger, infoDebugger); - return step(initialStep); - function sibling(name, initial) { - return utils_1.append(spawned, createLogger(label, key2.replace(/^[^:]+/, name), initial, infoDebugger)); - } - function step(phase) { - const stepPrefix = phase && `[${phase}]` || ""; - const debug = debugDebugger && prefixedLogger(debugDebugger, stepPrefix) || utils_1.NOOP; - const info = prefixedLogger(infoDebugger, `${labelPrefix} ${stepPrefix}`, debug); - return Object.assign(debugDebugger ? debug : info, { - label, - sibling, - info, - step - }); - } - } - exports.createLogger = createLogger; - var GitLogger = class { - constructor(_out = createLog()) { - this._out = _out; - this.error = prefixedLogger(_out, "[ERROR]"); - this.warn = prefixedLogger(_out, "[WARN]"); - } - silent(silence = false) { - if (silence !== this._out.enabled) { - return; - } - const { namespace } = this._out; - const env = (process.env.DEBUG || "").split(",").filter((s) => !!s); - const hasOn = env.includes(namespace); - const hasOff = env.includes(`-${namespace}`); - if (!silence) { - if (hasOff) { - utils_1.remove(env, `-${namespace}`); - } else { - env.push(namespace); - } - } else { - if (hasOn) { - utils_1.remove(env, namespace); - } else { - env.push(`-${namespace}`); - } - } - debug_1.default.enable(env.join(",")); - } - }; - exports.GitLogger = GitLogger; - } -}); - -// node_modules/simple-git/src/lib/runners/tasks-pending-queue.js -var require_tasks_pending_queue = __commonJS({ - "node_modules/simple-git/src/lib/runners/tasks-pending-queue.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.TasksPendingQueue = void 0; - var git_error_1 = require_git_error(); - var git_logger_1 = require_git_logger(); - var TasksPendingQueue = class { - constructor(logLabel = "GitExecutor") { - this.logLabel = logLabel; - this._queue = new Map(); - } - withProgress(task) { - return this._queue.get(task); - } - createProgress(task) { - const name = TasksPendingQueue.getName(task.commands[0]); - const logger = git_logger_1.createLogger(this.logLabel, name); - return { - task, - logger, - name - }; - } - push(task) { - const progress = this.createProgress(task); - progress.logger("Adding task to the queue, commands = %o", task.commands); - this._queue.set(task, progress); - return progress; - } - fatal(err) { - for (const [task, { logger }] of Array.from(this._queue.entries())) { - if (task === err.task) { - logger.info(`Failed %o`, err); - logger(`Fatal exception, any as-yet un-started tasks run through this executor will not be attempted`); - } else { - logger.info(`A fatal exception occurred in a previous task, the queue has been purged: %o`, err.message); - } - this.complete(task); - } - if (this._queue.size !== 0) { - throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`); - } - } - complete(task) { - const progress = this.withProgress(task); - if (progress) { - this._queue.delete(task); - } - } - attempt(task) { - const progress = this.withProgress(task); - if (!progress) { - throw new git_error_1.GitError(void 0, "TasksPendingQueue: attempt called for an unknown task"); - } - progress.logger("Starting task"); - return progress; - } - static getName(name = "empty") { - return `task:${name}:${++TasksPendingQueue.counter}`; - } - }; - exports.TasksPendingQueue = TasksPendingQueue; - TasksPendingQueue.counter = 0; - } -}); - -// node_modules/simple-git/src/lib/runners/git-executor-chain.js -var require_git_executor_chain = __commonJS({ - "node_modules/simple-git/src/lib/runners/git-executor-chain.js"(exports) { - "use strict"; - var __awaiter2 = exports && exports.__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()); - }); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GitExecutorChain = void 0; - var child_process_1 = require("child_process"); - var git_error_1 = require_git_error(); - var task_1 = require_task(); - var utils_1 = require_utils(); - var tasks_pending_queue_1 = require_tasks_pending_queue(); - var GitExecutorChain = class { - constructor(_executor, _scheduler, _plugins) { - this._executor = _executor; - this._scheduler = _scheduler; - this._plugins = _plugins; - this._chain = Promise.resolve(); - this._queue = new tasks_pending_queue_1.TasksPendingQueue(); - } - get binary() { - return this._executor.binary; - } - get cwd() { - return this._cwd || this._executor.cwd; - } - set cwd(cwd) { - this._cwd = cwd; - } - get env() { - return this._executor.env; - } - get outputHandler() { - return this._executor.outputHandler; - } - chain() { - return this; - } - push(task) { - this._queue.push(task); - return this._chain = this._chain.then(() => this.attemptTask(task)); - } - attemptTask(task) { - return __awaiter2(this, void 0, void 0, function* () { - const onScheduleComplete = yield this._scheduler.next(); - const onQueueComplete = () => this._queue.complete(task); - try { - const { logger } = this._queue.attempt(task); - return yield task_1.isEmptyTask(task) ? this.attemptEmptyTask(task, logger) : this.attemptRemoteTask(task, logger); - } catch (e) { - throw this.onFatalException(task, e); - } finally { - onQueueComplete(); - onScheduleComplete(); - } - }); - } - onFatalException(task, e) { - const gitError = e instanceof git_error_1.GitError ? Object.assign(e, { task }) : new git_error_1.GitError(task, e && String(e)); - this._chain = Promise.resolve(); - this._queue.fatal(gitError); - return gitError; - } - attemptRemoteTask(task, logger) { - return __awaiter2(this, void 0, void 0, function* () { - const args = this._plugins.exec("spawn.args", [...task.commands], pluginContext(task, task.commands)); - const raw = yield this.gitResponse(task, this.binary, args, this.outputHandler, logger.step("SPAWN")); - const outputStreams = yield this.handleTaskData(task, args, raw, logger.step("HANDLE")); - logger(`passing response to task's parser as a %s`, task.format); - if (task_1.isBufferTask(task)) { - return utils_1.callTaskParser(task.parser, outputStreams); - } - return utils_1.callTaskParser(task.parser, outputStreams.asStrings()); - }); - } - attemptEmptyTask(task, logger) { - return __awaiter2(this, void 0, void 0, function* () { - logger(`empty task bypassing child process to call to task's parser`); - return task.parser(this); - }); - } - handleTaskData(task, args, result, logger) { - const { exitCode, rejection, stdOut, stdErr } = result; - return new Promise((done, fail) => { - logger(`Preparing to handle process response exitCode=%d stdOut=`, exitCode); - const { error } = this._plugins.exec("task.error", { error: rejection }, Object.assign(Object.assign({}, pluginContext(task, args)), result)); - if (error && task.onError) { - logger.info(`exitCode=%s handling with custom error handler`); - return task.onError(result, error, (newStdOut) => { - logger.info(`custom error handler treated as success`); - logger(`custom error returned a %s`, utils_1.objectToString(newStdOut)); - done(new utils_1.GitOutputStreams(Array.isArray(newStdOut) ? Buffer.concat(newStdOut) : newStdOut, Buffer.concat(stdErr))); - }, fail); - } - if (error) { - logger.info(`handling as error: exitCode=%s stdErr=%s rejection=%o`, exitCode, stdErr.length, rejection); - return fail(error); - } - logger.info(`retrieving task output complete`); - done(new utils_1.GitOutputStreams(Buffer.concat(stdOut), Buffer.concat(stdErr))); - }); - } - gitResponse(task, command, args, outputHandler, logger) { - return __awaiter2(this, void 0, void 0, function* () { - const outputLogger = logger.sibling("output"); - const spawnOptions = this._plugins.exec("spawn.options", { - cwd: this.cwd, - env: this.env, - windowsHide: true - }, pluginContext(task, task.commands)); - return new Promise((done) => { - const stdOut = []; - const stdErr = []; - let rejection; - logger.info(`%s %o`, command, args); - logger("%O", spawnOptions); - const spawned = child_process_1.spawn(command, args, spawnOptions); - spawned.stdout.on("data", onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut"))); - spawned.stderr.on("data", onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr"))); - spawned.on("error", onErrorReceived(stdErr, logger)); - if (outputHandler) { - logger(`Passing child process stdOut/stdErr to custom outputHandler`); - outputHandler(command, spawned.stdout, spawned.stderr, [...args]); - } - this._plugins.exec("spawn.after", void 0, Object.assign(Object.assign({}, pluginContext(task, args)), { - spawned, - close(exitCode, reason) { - done({ - stdOut, - stdErr, - exitCode, - rejection: rejection || reason - }); - }, - kill(reason) { - if (spawned.killed) { - return; - } - rejection = reason; - spawned.kill("SIGINT"); - } - })); - }); - }); - } - }; - exports.GitExecutorChain = GitExecutorChain; - function pluginContext(task, commands) { - return { - method: utils_1.first(task.commands) || "", - commands - }; - } - function onErrorReceived(target, logger) { - return (err) => { - logger(`[ERROR] child process exception %o`, err); - target.push(Buffer.from(String(err.stack), "ascii")); - }; - } - function onDataReceived(target, name, logger, output) { - return (buffer) => { - logger(`%s received %L bytes`, name, buffer); - output(`%B`, buffer); - target.push(buffer); - }; - } - } -}); - -// node_modules/simple-git/src/lib/runners/git-executor.js -var require_git_executor = __commonJS({ - "node_modules/simple-git/src/lib/runners/git-executor.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GitExecutor = void 0; - var git_executor_chain_1 = require_git_executor_chain(); - var GitExecutor = class { - constructor(binary = "git", cwd, _scheduler, _plugins) { - this.binary = binary; - this.cwd = cwd; - this._scheduler = _scheduler; - this._plugins = _plugins; - this._chain = new git_executor_chain_1.GitExecutorChain(this, this._scheduler, this._plugins); - } - chain() { - return new git_executor_chain_1.GitExecutorChain(this, this._scheduler, this._plugins); - } - push(task) { - return this._chain.push(task); - } - }; - exports.GitExecutor = GitExecutor; - } -}); - -// node_modules/simple-git/src/lib/task-callback.js -var require_task_callback = __commonJS({ - "node_modules/simple-git/src/lib/task-callback.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.taskCallback = void 0; - var git_response_error_1 = require_git_response_error(); - var utils_1 = require_utils(); - function taskCallback(task, response, callback = utils_1.NOOP) { - const onSuccess = (data) => { - callback(null, data); - }; - const onError = (err) => { - if ((err === null || err === void 0 ? void 0 : err.task) === task) { - callback(err instanceof git_response_error_1.GitResponseError ? addDeprecationNoticeToError(err) : err, void 0); - } - }; - response.then(onSuccess, onError); - } - exports.taskCallback = taskCallback; - function addDeprecationNoticeToError(err) { - let log = (name) => { - console.warn(`simple-git deprecation notice: accessing GitResponseError.${name} should be GitResponseError.git.${name}, this will no longer be available in version 3`); - log = utils_1.NOOP; - }; - return Object.create(err, Object.getOwnPropertyNames(err.git).reduce(descriptorReducer, {})); - function descriptorReducer(all, name) { - if (name in err) { - return all; - } - all[name] = { - enumerable: false, - configurable: false, - get() { - log(name); - return err.git[name]; - } - }; - return all; - } - } - } -}); - -// node_modules/simple-git/src/lib/tasks/change-working-directory.js -var require_change_working_directory = __commonJS({ - "node_modules/simple-git/src/lib/tasks/change-working-directory.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.changeWorkingDirectoryTask = void 0; - var utils_1 = require_utils(); - var task_1 = require_task(); - function changeWorkingDirectoryTask(directory, root) { - return task_1.adhocExecTask((instance5) => { - if (!utils_1.folderExists(directory)) { - throw new Error(`Git.cwd: cannot change to non-directory "${directory}"`); - } - return (root || instance5).cwd = directory; - }); - } - exports.changeWorkingDirectoryTask = changeWorkingDirectoryTask; - } -}); - -// node_modules/simple-git/src/lib/tasks/hash-object.js -var require_hash_object = __commonJS({ - "node_modules/simple-git/src/lib/tasks/hash-object.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.hashObjectTask = void 0; - var task_1 = require_task(); - function hashObjectTask(filePath, write) { - const commands = ["hash-object", filePath]; - if (write) { - commands.push("-w"); - } - return task_1.straightThroughStringTask(commands, true); - } - exports.hashObjectTask = hashObjectTask; - } -}); - -// node_modules/simple-git/src/lib/responses/InitSummary.js -var require_InitSummary = __commonJS({ - "node_modules/simple-git/src/lib/responses/InitSummary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseInit = exports.InitSummary = void 0; - var InitSummary = class { - constructor(bare, path3, existing, gitDir) { - this.bare = bare; - this.path = path3; - this.existing = existing; - this.gitDir = gitDir; - } - }; - exports.InitSummary = InitSummary; - var initResponseRegex = /^Init.+ repository in (.+)$/; - var reInitResponseRegex = /^Rein.+ in (.+)$/; - function parseInit(bare, path3, text2) { - const response = String(text2).trim(); - let result; - if (result = initResponseRegex.exec(response)) { - return new InitSummary(bare, path3, false, result[1]); - } - if (result = reInitResponseRegex.exec(response)) { - return new InitSummary(bare, path3, true, result[1]); - } - let gitDir = ""; - const tokens = response.split(" "); - while (tokens.length) { - const token = tokens.shift(); - if (token === "in") { - gitDir = tokens.join(" "); - break; - } - } - return new InitSummary(bare, path3, /^re/i.test(response), gitDir); - } - exports.parseInit = parseInit; - } -}); - -// node_modules/simple-git/src/lib/tasks/init.js -var require_init = __commonJS({ - "node_modules/simple-git/src/lib/tasks/init.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.initTask = void 0; - var InitSummary_1 = require_InitSummary(); - var bareCommand = "--bare"; - function hasBareCommand(command) { - return command.includes(bareCommand); - } - function initTask(bare = false, path3, customArgs) { - const commands = ["init", ...customArgs]; - if (bare && !hasBareCommand(commands)) { - commands.splice(1, 0, bareCommand); - } - return { - commands, - format: "utf-8", - parser(text2) { - return InitSummary_1.parseInit(commands.includes("--bare"), path3, text2); - } - }; - } - exports.initTask = initTask; - } -}); - -// node_modules/simple-git/src/lib/responses/DiffSummary.js -var require_DiffSummary = __commonJS({ - "node_modules/simple-git/src/lib/responses/DiffSummary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DiffSummary = void 0; - var DiffSummary = class { - constructor() { - this.changed = 0; - this.deletions = 0; - this.insertions = 0; - this.files = []; - } - }; - exports.DiffSummary = DiffSummary; - } -}); - -// node_modules/simple-git/src/lib/parsers/parse-diff-summary.js -var require_parse_diff_summary = __commonJS({ - "node_modules/simple-git/src/lib/parsers/parse-diff-summary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseDiffResult = void 0; - var DiffSummary_1 = require_DiffSummary(); - function parseDiffResult(stdOut) { - const lines = stdOut.trim().split("\n"); - const status = new DiffSummary_1.DiffSummary(); - readSummaryLine(status, lines.pop()); - for (let i = 0, max = lines.length; i < max; i++) { - const line = lines[i]; - textFileChange(line, status) || binaryFileChange(line, status); - } - return status; - } - exports.parseDiffResult = parseDiffResult; - function readSummaryLine(status, summary) { - (summary || "").trim().split(", ").forEach(function(text2) { - const summary2 = /(\d+)\s([a-z]+)/.exec(text2); - if (!summary2) { - return; - } - summaryType(status, summary2[2], parseInt(summary2[1], 10)); - }); - } - function summaryType(status, key2, value) { - const match = /([a-z]+?)s?\b/.exec(key2); - if (!match || !statusUpdate[match[1]]) { - return; - } - statusUpdate[match[1]](status, value); - } - var statusUpdate = { - file(status, value) { - status.changed = value; - }, - deletion(status, value) { - status.deletions = value; - }, - insertion(status, value) { - status.insertions = value; - } - }; - function textFileChange(input, { files }) { - const line = input.trim().match(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/); - if (line) { - var alterations = (line[3] || "").trim(); - files.push({ - file: line[1].trim(), - changes: parseInt(line[2], 10), - insertions: alterations.replace(/-/g, "").length, - deletions: alterations.replace(/\+/g, "").length, - binary: false - }); - return true; - } - return false; - } - function binaryFileChange(input, { files }) { - const line = input.match(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)$/); - if (line) { - files.push({ - file: line[1].trim(), - before: +line[2], - after: +line[3], - binary: true - }); - return true; - } - return false; - } - } -}); - -// node_modules/simple-git/src/lib/parsers/parse-list-log-summary.js -var require_parse_list_log_summary = __commonJS({ - "node_modules/simple-git/src/lib/parsers/parse-list-log-summary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createListLogSummaryParser = exports.SPLITTER = exports.COMMIT_BOUNDARY = exports.START_BOUNDARY = void 0; - var utils_1 = require_utils(); - var parse_diff_summary_1 = require_parse_diff_summary(); - exports.START_BOUNDARY = "\xF2\xF2\xF2\xF2\xF2\xF2 "; - exports.COMMIT_BOUNDARY = " \xF2\xF2"; - exports.SPLITTER = " \xF2 "; - var defaultFieldNames = ["hash", "date", "message", "refs", "author_name", "author_email"]; - function lineBuilder(tokens, fields) { - return fields.reduce((line, field, index) => { - line[field] = tokens[index] || ""; - return line; - }, Object.create({ diff: null })); - } - function createListLogSummaryParser(splitter = exports.SPLITTER, fields = defaultFieldNames) { - return function(stdOut) { - const all = utils_1.toLinesWithContent(stdOut, true, exports.START_BOUNDARY).map(function(item) { - const lineDetail = item.trim().split(exports.COMMIT_BOUNDARY); - const listLogLine = lineBuilder(lineDetail[0].trim().split(splitter), fields); - if (lineDetail.length > 1 && !!lineDetail[1].trim()) { - listLogLine.diff = parse_diff_summary_1.parseDiffResult(lineDetail[1]); - } - return listLogLine; - }); - return { - all, - latest: all.length && all[0] || null, - total: all.length - }; - }; - } - exports.createListLogSummaryParser = createListLogSummaryParser; - } -}); - -// node_modules/simple-git/src/lib/tasks/log.js -var require_log = __commonJS({ - "node_modules/simple-git/src/lib/tasks/log.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.logTask = exports.parseLogOptions = void 0; - var parse_list_log_summary_1 = require_parse_list_log_summary(); - var utils_1 = require_utils(); - var task_1 = require_task(); - var excludeOptions; - (function(excludeOptions2) { - excludeOptions2[excludeOptions2["--pretty"] = 0] = "--pretty"; - excludeOptions2[excludeOptions2["max-count"] = 1] = "max-count"; - excludeOptions2[excludeOptions2["maxCount"] = 2] = "maxCount"; - excludeOptions2[excludeOptions2["n"] = 3] = "n"; - excludeOptions2[excludeOptions2["file"] = 4] = "file"; - excludeOptions2[excludeOptions2["format"] = 5] = "format"; - excludeOptions2[excludeOptions2["from"] = 6] = "from"; - excludeOptions2[excludeOptions2["to"] = 7] = "to"; - excludeOptions2[excludeOptions2["splitter"] = 8] = "splitter"; - excludeOptions2[excludeOptions2["symmetric"] = 9] = "symmetric"; - excludeOptions2[excludeOptions2["mailMap"] = 10] = "mailMap"; - excludeOptions2[excludeOptions2["multiLine"] = 11] = "multiLine"; - excludeOptions2[excludeOptions2["strictDate"] = 12] = "strictDate"; - })(excludeOptions || (excludeOptions = {})); - function prettyFormat(format, splitter) { - const fields = []; - const formatStr = []; - Object.keys(format).forEach((field) => { - fields.push(field); - formatStr.push(String(format[field])); - }); - return [ - fields, - formatStr.join(splitter) - ]; - } - function userOptions(input) { - const output = Object.assign({}, input); - Object.keys(input).forEach((key2) => { - if (key2 in excludeOptions) { - delete output[key2]; - } - }); - return output; - } - function parseLogOptions(opt = {}, customArgs = []) { - const splitter = opt.splitter || parse_list_log_summary_1.SPLITTER; - const format = opt.format || { - hash: "%H", - date: opt.strictDate === false ? "%ai" : "%aI", - message: "%s", - refs: "%D", - body: opt.multiLine ? "%B" : "%b", - author_name: opt.mailMap !== false ? "%aN" : "%an", - author_email: opt.mailMap !== false ? "%aE" : "%ae" - }; - const [fields, formatStr] = prettyFormat(format, splitter); - const suffix = []; - const command = [ - `--pretty=format:${parse_list_log_summary_1.START_BOUNDARY}${formatStr}${parse_list_log_summary_1.COMMIT_BOUNDARY}`, - ...customArgs - ]; - const maxCount = opt.n || opt["max-count"] || opt.maxCount; - if (maxCount) { - command.push(`--max-count=${maxCount}`); - } - if (opt.from && opt.to) { - const rangeOperator = opt.symmetric !== false ? "..." : ".."; - suffix.push(`${opt.from}${rangeOperator}${opt.to}`); - } - if (opt.file) { - suffix.push("--follow", opt.file); - } - utils_1.appendTaskOptions(userOptions(opt), command); - return { - fields, - splitter, - commands: [ - ...command, - ...suffix - ] - }; - } - exports.parseLogOptions = parseLogOptions; - function logTask(splitter, fields, customArgs) { - return { - commands: ["log", ...customArgs], - format: "utf-8", - parser: parse_list_log_summary_1.createListLogSummaryParser(splitter, fields) - }; - } - exports.logTask = logTask; - function default_1() { - return { - log(...rest) { - const next = utils_1.trailingFunctionArgument(arguments); - const task = rejectDeprecatedSignatures(...rest) || createLogTask(parseLogOptions(utils_1.trailingOptionsArgument(arguments), utils_1.filterType(arguments[0], utils_1.filterArray))); - return this._runTask(task, next); - } - }; - function createLogTask(options) { - return logTask(options.splitter, options.fields, options.commands); - } - function rejectDeprecatedSignatures(from, to) { - return utils_1.filterString(from) && utils_1.filterString(to) && task_1.configurationErrorTask(`git.log(string, string) should be replaced with git.log({ from: string, to: string })`); - } - } - exports.default = default_1; - } -}); - -// node_modules/simple-git/src/lib/responses/MergeSummary.js -var require_MergeSummary = __commonJS({ - "node_modules/simple-git/src/lib/responses/MergeSummary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MergeSummaryDetail = exports.MergeSummaryConflict = void 0; - var MergeSummaryConflict = class { - constructor(reason, file = null, meta) { - this.reason = reason; - this.file = file; - this.meta = meta; - } - toString() { - return `${this.file}:${this.reason}`; - } - }; - exports.MergeSummaryConflict = MergeSummaryConflict; - var MergeSummaryDetail = class { - constructor() { - this.conflicts = []; - this.merges = []; - this.result = "success"; - } - get failed() { - return this.conflicts.length > 0; - } - get reason() { - return this.result; - } - toString() { - if (this.conflicts.length) { - return `CONFLICTS: ${this.conflicts.join(", ")}`; - } - return "OK"; - } - }; - exports.MergeSummaryDetail = MergeSummaryDetail; - } -}); - -// node_modules/simple-git/src/lib/responses/PullSummary.js -var require_PullSummary = __commonJS({ - "node_modules/simple-git/src/lib/responses/PullSummary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.PullSummary = void 0; - var PullSummary = class { - constructor() { - this.remoteMessages = { - all: [] - }; - this.created = []; - this.deleted = []; - this.files = []; - this.deletions = {}; - this.insertions = {}; - this.summary = { - changes: 0, - deletions: 0, - insertions: 0 - }; - } - }; - exports.PullSummary = PullSummary; - } -}); - -// node_modules/simple-git/src/lib/parsers/parse-remote-objects.js -var require_parse_remote_objects = __commonJS({ - "node_modules/simple-git/src/lib/parsers/parse-remote-objects.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.remoteMessagesObjectParsers = void 0; - var utils_1 = require_utils(); - function objectEnumerationResult(remoteMessages) { - return remoteMessages.objects = remoteMessages.objects || { - compressing: 0, - counting: 0, - enumerating: 0, - packReused: 0, - reused: { count: 0, delta: 0 }, - total: { count: 0, delta: 0 } - }; - } - function asObjectCount(source) { - const count = /^\s*(\d+)/.exec(source); - const delta = /delta (\d+)/i.exec(source); - return { - count: utils_1.asNumber(count && count[1] || "0"), - delta: utils_1.asNumber(delta && delta[1] || "0") - }; - } - exports.remoteMessagesObjectParsers = [ - new utils_1.RemoteLineParser(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i, (result, [action, count]) => { - const key2 = action.toLowerCase(); - const enumeration = objectEnumerationResult(result.remoteMessages); - Object.assign(enumeration, { [key2]: utils_1.asNumber(count) }); - }), - new utils_1.RemoteLineParser(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i, (result, [action, count]) => { - const key2 = action.toLowerCase(); - const enumeration = objectEnumerationResult(result.remoteMessages); - Object.assign(enumeration, { [key2]: utils_1.asNumber(count) }); - }), - new utils_1.RemoteLineParser(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i, (result, [total, reused, packReused]) => { - const objects = objectEnumerationResult(result.remoteMessages); - objects.total = asObjectCount(total); - objects.reused = asObjectCount(reused); - objects.packReused = utils_1.asNumber(packReused); - }) - ]; - } -}); - -// node_modules/simple-git/src/lib/parsers/parse-remote-messages.js -var require_parse_remote_messages = __commonJS({ - "node_modules/simple-git/src/lib/parsers/parse-remote-messages.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RemoteMessageSummary = exports.parseRemoteMessages = void 0; - var utils_1 = require_utils(); - var parse_remote_objects_1 = require_parse_remote_objects(); - var parsers = [ - new utils_1.RemoteLineParser(/^remote:\s*(.+)$/, (result, [text2]) => { - result.remoteMessages.all.push(text2.trim()); - return false; - }), - ...parse_remote_objects_1.remoteMessagesObjectParsers, - new utils_1.RemoteLineParser([/create a (?:pull|merge) request/i, /\s(https?:\/\/\S+)$/], (result, [pullRequestUrl]) => { - result.remoteMessages.pullRequestUrl = pullRequestUrl; - }), - new utils_1.RemoteLineParser([/found (\d+) vulnerabilities.+\(([^)]+)\)/i, /\s(https?:\/\/\S+)$/], (result, [count, summary, url]) => { - result.remoteMessages.vulnerabilities = { - count: utils_1.asNumber(count), - summary, - url - }; - }) - ]; - function parseRemoteMessages(_stdOut, stdErr) { - return utils_1.parseStringResponse({ remoteMessages: new RemoteMessageSummary() }, parsers, stdErr); - } - exports.parseRemoteMessages = parseRemoteMessages; - var RemoteMessageSummary = class { - constructor() { - this.all = []; - } - }; - exports.RemoteMessageSummary = RemoteMessageSummary; - } -}); - -// node_modules/simple-git/src/lib/parsers/parse-pull.js -var require_parse_pull = __commonJS({ - "node_modules/simple-git/src/lib/parsers/parse-pull.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parsePullResult = exports.parsePullDetail = void 0; - var PullSummary_1 = require_PullSummary(); - var utils_1 = require_utils(); - var parse_remote_messages_1 = require_parse_remote_messages(); - var FILE_UPDATE_REGEX = /^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/; - var SUMMARY_REGEX = /(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/; - var ACTION_REGEX = /^(create|delete) mode \d+ (.+)/; - var parsers = [ - new utils_1.LineParser(FILE_UPDATE_REGEX, (result, [file, insertions, deletions]) => { - result.files.push(file); - if (insertions) { - result.insertions[file] = insertions.length; - } - if (deletions) { - result.deletions[file] = deletions.length; - } - }), - new utils_1.LineParser(SUMMARY_REGEX, (result, [changes, , insertions, , deletions]) => { - if (insertions !== void 0 || deletions !== void 0) { - result.summary.changes = +changes || 0; - result.summary.insertions = +insertions || 0; - result.summary.deletions = +deletions || 0; - return true; - } - return false; - }), - new utils_1.LineParser(ACTION_REGEX, (result, [action, file]) => { - utils_1.append(result.files, file); - utils_1.append(action === "create" ? result.created : result.deleted, file); - }) - ]; - var parsePullDetail = (stdOut, stdErr) => { - return utils_1.parseStringResponse(new PullSummary_1.PullSummary(), parsers, stdOut, stdErr); - }; - exports.parsePullDetail = parsePullDetail; - var parsePullResult = (stdOut, stdErr) => { - return Object.assign(new PullSummary_1.PullSummary(), exports.parsePullDetail(stdOut, stdErr), parse_remote_messages_1.parseRemoteMessages(stdOut, stdErr)); - }; - exports.parsePullResult = parsePullResult; - } -}); - -// node_modules/simple-git/src/lib/parsers/parse-merge.js -var require_parse_merge = __commonJS({ - "node_modules/simple-git/src/lib/parsers/parse-merge.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseMergeDetail = exports.parseMergeResult = void 0; - var MergeSummary_1 = require_MergeSummary(); - var utils_1 = require_utils(); - var parse_pull_1 = require_parse_pull(); - var parsers = [ - new utils_1.LineParser(/^Auto-merging\s+(.+)$/, (summary, [autoMerge]) => { - summary.merges.push(autoMerge); - }), - new utils_1.LineParser(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/, (summary, [reason, file]) => { - summary.conflicts.push(new MergeSummary_1.MergeSummaryConflict(reason, file)); - }), - new utils_1.LineParser(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/, (summary, [reason, file, deleteRef]) => { - summary.conflicts.push(new MergeSummary_1.MergeSummaryConflict(reason, file, { deleteRef })); - }), - new utils_1.LineParser(/^CONFLICT\s+\((.+)\):/, (summary, [reason]) => { - summary.conflicts.push(new MergeSummary_1.MergeSummaryConflict(reason, null)); - }), - new utils_1.LineParser(/^Automatic merge failed;\s+(.+)$/, (summary, [result]) => { - summary.result = result; - }) - ]; - var parseMergeResult = (stdOut, stdErr) => { - return Object.assign(exports.parseMergeDetail(stdOut, stdErr), parse_pull_1.parsePullResult(stdOut, stdErr)); - }; - exports.parseMergeResult = parseMergeResult; - var parseMergeDetail = (stdOut) => { - return utils_1.parseStringResponse(new MergeSummary_1.MergeSummaryDetail(), parsers, stdOut); - }; - exports.parseMergeDetail = parseMergeDetail; - } -}); - -// node_modules/simple-git/src/lib/tasks/merge.js -var require_merge = __commonJS({ - "node_modules/simple-git/src/lib/tasks/merge.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.mergeTask = void 0; - var git_response_error_1 = require_git_response_error(); - var parse_merge_1 = require_parse_merge(); - var task_1 = require_task(); - function mergeTask(customArgs) { - if (!customArgs.length) { - return task_1.configurationErrorTask("Git.merge requires at least one option"); - } - return { - commands: ["merge", ...customArgs], - format: "utf-8", - parser(stdOut, stdErr) { - const merge = parse_merge_1.parseMergeResult(stdOut, stdErr); - if (merge.failed) { - throw new git_response_error_1.GitResponseError(merge); - } - return merge; - } - }; - } - exports.mergeTask = mergeTask; - } -}); - -// node_modules/simple-git/src/lib/parsers/parse-push.js -var require_parse_push = __commonJS({ - "node_modules/simple-git/src/lib/parsers/parse-push.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parsePushDetail = exports.parsePushResult = void 0; - var utils_1 = require_utils(); - var parse_remote_messages_1 = require_parse_remote_messages(); - function pushResultPushedItem(local, remote, status) { - const deleted = status.includes("deleted"); - const tag = status.includes("tag") || /^refs\/tags/.test(local); - const alreadyUpdated = !status.includes("new"); - return { - deleted, - tag, - branch: !tag, - new: !alreadyUpdated, - alreadyUpdated, - local, - remote - }; - } - var parsers = [ - new utils_1.LineParser(/^Pushing to (.+)$/, (result, [repo]) => { - result.repo = repo; - }), - new utils_1.LineParser(/^updating local tracking ref '(.+)'/, (result, [local]) => { - result.ref = Object.assign(Object.assign({}, result.ref || {}), { local }); - }), - new utils_1.LineParser(/^[*-=]\s+([^:]+):(\S+)\s+\[(.+)]$/, (result, [local, remote, type]) => { - result.pushed.push(pushResultPushedItem(local, remote, type)); - }), - new utils_1.LineParser(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/, (result, [local, remote, remoteName]) => { - result.branch = Object.assign(Object.assign({}, result.branch || {}), { - local, - remote, - remoteName - }); - }), - new utils_1.LineParser(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/, (result, [local, remote, from, to]) => { - result.update = { - head: { - local, - remote - }, - hash: { - from, - to - } - }; - }) - ]; - var parsePushResult = (stdOut, stdErr) => { - const pushDetail = exports.parsePushDetail(stdOut, stdErr); - const responseDetail = parse_remote_messages_1.parseRemoteMessages(stdOut, stdErr); - return Object.assign(Object.assign({}, pushDetail), responseDetail); - }; - exports.parsePushResult = parsePushResult; - var parsePushDetail = (stdOut, stdErr) => { - return utils_1.parseStringResponse({ pushed: [] }, parsers, stdOut, stdErr); - }; - exports.parsePushDetail = parsePushDetail; - } -}); - -// node_modules/simple-git/src/lib/tasks/push.js -var require_push = __commonJS({ - "node_modules/simple-git/src/lib/tasks/push.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.pushTask = exports.pushTagsTask = void 0; - var parse_push_1 = require_parse_push(); - var utils_1 = require_utils(); - function pushTagsTask(ref = {}, customArgs) { - utils_1.append(customArgs, "--tags"); - return pushTask(ref, customArgs); - } - exports.pushTagsTask = pushTagsTask; - function pushTask(ref = {}, customArgs) { - const commands = ["push", ...customArgs]; - if (ref.branch) { - commands.splice(1, 0, ref.branch); - } - if (ref.remote) { - commands.splice(1, 0, ref.remote); - } - utils_1.remove(commands, "-v"); - utils_1.append(commands, "--verbose"); - utils_1.append(commands, "--porcelain"); - return { - commands, - format: "utf-8", - parser: parse_push_1.parsePushResult - }; - } - exports.pushTask = pushTask; - } -}); - -// node_modules/simple-git/src/lib/responses/FileStatusSummary.js -var require_FileStatusSummary = __commonJS({ - "node_modules/simple-git/src/lib/responses/FileStatusSummary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.FileStatusSummary = exports.fromPathRegex = void 0; - exports.fromPathRegex = /^(.+) -> (.+)$/; - var FileStatusSummary = class { - constructor(path3, index, working_dir) { - this.path = path3; - this.index = index; - this.working_dir = working_dir; - if (index + working_dir === "R") { - const detail = exports.fromPathRegex.exec(path3) || [null, path3, path3]; - this.from = detail[1] || ""; - this.path = detail[2] || ""; - } - } - }; - exports.FileStatusSummary = FileStatusSummary; - } -}); - -// node_modules/simple-git/src/lib/responses/StatusSummary.js -var require_StatusSummary = __commonJS({ - "node_modules/simple-git/src/lib/responses/StatusSummary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseStatusSummary = exports.StatusSummary = void 0; - var utils_1 = require_utils(); - var FileStatusSummary_1 = require_FileStatusSummary(); - var StatusSummary = class { - constructor() { - this.not_added = []; - this.conflicted = []; - this.created = []; - this.deleted = []; - this.modified = []; - this.renamed = []; - this.files = []; - this.staged = []; - this.ahead = 0; - this.behind = 0; - this.current = null; - this.tracking = null; - this.detached = false; - } - isClean() { - return !this.files.length; - } - }; - exports.StatusSummary = StatusSummary; - var PorcelainFileStatus; - (function(PorcelainFileStatus2) { - PorcelainFileStatus2["ADDED"] = "A"; - PorcelainFileStatus2["DELETED"] = "D"; - PorcelainFileStatus2["MODIFIED"] = "M"; - PorcelainFileStatus2["RENAMED"] = "R"; - PorcelainFileStatus2["COPIED"] = "C"; - PorcelainFileStatus2["UNMERGED"] = "U"; - PorcelainFileStatus2["UNTRACKED"] = "?"; - PorcelainFileStatus2["IGNORED"] = "!"; - PorcelainFileStatus2["NONE"] = " "; - })(PorcelainFileStatus || (PorcelainFileStatus = {})); - function renamedFile(line) { - const detail = /^(.+) -> (.+)$/.exec(line); - if (!detail) { - return { - from: line, - to: line - }; - } - return { - from: String(detail[1]), - to: String(detail[2]) - }; - } - function parser(indexX, indexY, handler) { - return [`${indexX}${indexY}`, handler]; - } - function conflicts(indexX, ...indexY) { - return indexY.map((y) => parser(indexX, y, (result, file) => utils_1.append(result.conflicted, file))); - } - var parsers = new Map([ - parser(PorcelainFileStatus.NONE, PorcelainFileStatus.ADDED, (result, file) => utils_1.append(result.created, file)), - parser(PorcelainFileStatus.NONE, PorcelainFileStatus.DELETED, (result, file) => utils_1.append(result.deleted, file)), - parser(PorcelainFileStatus.NONE, PorcelainFileStatus.MODIFIED, (result, file) => utils_1.append(result.modified, file)), - parser(PorcelainFileStatus.ADDED, PorcelainFileStatus.NONE, (result, file) => utils_1.append(result.created, file) && utils_1.append(result.staged, file)), - parser(PorcelainFileStatus.ADDED, PorcelainFileStatus.MODIFIED, (result, file) => utils_1.append(result.created, file) && utils_1.append(result.staged, file) && utils_1.append(result.modified, file)), - parser(PorcelainFileStatus.DELETED, PorcelainFileStatus.NONE, (result, file) => utils_1.append(result.deleted, file) && utils_1.append(result.staged, file)), - parser(PorcelainFileStatus.MODIFIED, PorcelainFileStatus.NONE, (result, file) => utils_1.append(result.modified, file) && utils_1.append(result.staged, file)), - parser(PorcelainFileStatus.MODIFIED, PorcelainFileStatus.MODIFIED, (result, file) => utils_1.append(result.modified, file) && utils_1.append(result.staged, file)), - parser(PorcelainFileStatus.RENAMED, PorcelainFileStatus.NONE, (result, file) => { - utils_1.append(result.renamed, renamedFile(file)); - }), - parser(PorcelainFileStatus.RENAMED, PorcelainFileStatus.MODIFIED, (result, file) => { - const renamed = renamedFile(file); - utils_1.append(result.renamed, renamed); - utils_1.append(result.modified, renamed.to); - }), - parser(PorcelainFileStatus.UNTRACKED, PorcelainFileStatus.UNTRACKED, (result, file) => utils_1.append(result.not_added, file)), - ...conflicts(PorcelainFileStatus.ADDED, PorcelainFileStatus.ADDED, PorcelainFileStatus.UNMERGED), - ...conflicts(PorcelainFileStatus.DELETED, PorcelainFileStatus.DELETED, PorcelainFileStatus.UNMERGED), - ...conflicts(PorcelainFileStatus.UNMERGED, PorcelainFileStatus.ADDED, PorcelainFileStatus.DELETED, PorcelainFileStatus.UNMERGED), - ["##", (result, line) => { - const aheadReg = /ahead (\d+)/; - const behindReg = /behind (\d+)/; - const currentReg = /^(.+?(?=(?:\.{3}|\s|$)))/; - const trackingReg = /\.{3}(\S*)/; - const onEmptyBranchReg = /\son\s([\S]+)$/; - let regexResult; - regexResult = aheadReg.exec(line); - result.ahead = regexResult && +regexResult[1] || 0; - regexResult = behindReg.exec(line); - result.behind = regexResult && +regexResult[1] || 0; - regexResult = currentReg.exec(line); - result.current = regexResult && regexResult[1]; - regexResult = trackingReg.exec(line); - result.tracking = regexResult && regexResult[1]; - regexResult = onEmptyBranchReg.exec(line); - result.current = regexResult && regexResult[1] || result.current; - result.detached = /\(no branch\)/.test(line); - }] - ]); - var parseStatusSummary = function(text2) { - const lines = text2.trim().split("\n"); - const status = new StatusSummary(); - for (let i = 0, l = lines.length; i < l; i++) { - splitLine(status, lines[i]); - } - return status; - }; - exports.parseStatusSummary = parseStatusSummary; - function splitLine(result, lineStr) { - const trimmed = lineStr.trim(); - switch (" ") { - case trimmed.charAt(2): - return data(trimmed.charAt(0), trimmed.charAt(1), trimmed.substr(3)); - case trimmed.charAt(1): - return data(PorcelainFileStatus.NONE, trimmed.charAt(0), trimmed.substr(2)); - default: - return; - } - function data(index, workingDir, path3) { - const raw = `${index}${workingDir}`; - const handler = parsers.get(raw); - if (handler) { - handler(result, path3); - } - if (raw !== "##") { - result.files.push(new FileStatusSummary_1.FileStatusSummary(path3, index, workingDir)); - } - } - } - } -}); - -// node_modules/simple-git/src/lib/tasks/status.js -var require_status = __commonJS({ - "node_modules/simple-git/src/lib/tasks/status.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.statusTask = void 0; - var StatusSummary_1 = require_StatusSummary(); - function statusTask(customArgs) { - return { - format: "utf-8", - commands: ["status", "--porcelain", "-b", "-u", ...customArgs], - parser(text2) { - return StatusSummary_1.parseStatusSummary(text2); - } - }; - } - exports.statusTask = statusTask; - } -}); - -// node_modules/simple-git/src/lib/simple-git-api.js -var require_simple_git_api = __commonJS({ - "node_modules/simple-git/src/lib/simple-git-api.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.SimpleGitApi = void 0; - var task_callback_1 = require_task_callback(); - var change_working_directory_1 = require_change_working_directory(); - var config_1 = require_config(); - var grep_1 = require_grep(); - var hash_object_1 = require_hash_object(); - var init_1 = require_init(); - var log_1 = require_log(); - var merge_1 = require_merge(); - var push_1 = require_push(); - var status_1 = require_status(); - var task_1 = require_task(); - var utils_1 = require_utils(); - var SimpleGitApi = class { - constructor(_executor) { - this._executor = _executor; - } - _runTask(task, then) { - const chain = this._executor.chain(); - const promise2 = chain.push(task); - if (then) { - task_callback_1.taskCallback(task, promise2, then); - } - return Object.create(this, { - then: { value: promise2.then.bind(promise2) }, - catch: { value: promise2.catch.bind(promise2) }, - _executor: { value: chain } - }); - } - add(files) { - return this._runTask(task_1.straightThroughStringTask(["add", ...utils_1.asArray(files)]), utils_1.trailingFunctionArgument(arguments)); - } - cwd(directory) { - const next = utils_1.trailingFunctionArgument(arguments); - if (typeof directory === "string") { - return this._runTask(change_working_directory_1.changeWorkingDirectoryTask(directory, this._executor), next); - } - if (typeof (directory === null || directory === void 0 ? void 0 : directory.path) === "string") { - return this._runTask(change_working_directory_1.changeWorkingDirectoryTask(directory.path, directory.root && this._executor || void 0), next); - } - return this._runTask(task_1.configurationErrorTask("Git.cwd: workingDirectory must be supplied as a string"), next); - } - hashObject(path3, write) { - return this._runTask(hash_object_1.hashObjectTask(path3, write === true), utils_1.trailingFunctionArgument(arguments)); - } - init(bare) { - return this._runTask(init_1.initTask(bare === true, this._executor.cwd, utils_1.getTrailingOptions(arguments)), utils_1.trailingFunctionArgument(arguments)); - } - merge() { - return this._runTask(merge_1.mergeTask(utils_1.getTrailingOptions(arguments)), utils_1.trailingFunctionArgument(arguments)); - } - mergeFromTo(remote, branch) { - if (!(utils_1.filterString(remote) && utils_1.filterString(branch))) { - return this._runTask(task_1.configurationErrorTask(`Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`)); - } - return this._runTask(merge_1.mergeTask([remote, branch, ...utils_1.getTrailingOptions(arguments)]), utils_1.trailingFunctionArgument(arguments, false)); - } - outputHandler(handler) { - this._executor.outputHandler = handler; - return this; - } - push() { - const task = push_1.pushTask({ - remote: utils_1.filterType(arguments[0], utils_1.filterString), - branch: utils_1.filterType(arguments[1], utils_1.filterString) - }, utils_1.getTrailingOptions(arguments)); - return this._runTask(task, utils_1.trailingFunctionArgument(arguments)); - } - stash() { - return this._runTask(task_1.straightThroughStringTask(["stash", ...utils_1.getTrailingOptions(arguments)]), utils_1.trailingFunctionArgument(arguments)); - } - status() { - return this._runTask(status_1.statusTask(utils_1.getTrailingOptions(arguments)), utils_1.trailingFunctionArgument(arguments)); - } - }; - exports.SimpleGitApi = SimpleGitApi; - Object.assign(SimpleGitApi.prototype, config_1.default(), grep_1.default(), log_1.default()); - } -}); - -// node_modules/simple-git/src/lib/runners/scheduler.js -var require_scheduler = __commonJS({ - "node_modules/simple-git/src/lib/runners/scheduler.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Scheduler = void 0; - var utils_1 = require_utils(); - var promise_deferred_1 = require_dist2(); - var git_logger_1 = require_git_logger(); - var createScheduledTask = (() => { - let id = 0; - return () => { - id++; - const { promise: promise2, done } = promise_deferred_1.createDeferred(); - return { - promise: promise2, - done, - id - }; - }; - })(); - var Scheduler = class { - constructor(concurrency = 2) { - this.concurrency = concurrency; - this.logger = git_logger_1.createLogger("", "scheduler"); - this.pending = []; - this.running = []; - this.logger(`Constructed, concurrency=%s`, concurrency); - } - schedule() { - if (!this.pending.length || this.running.length >= this.concurrency) { - this.logger(`Schedule attempt ignored, pending=%s running=%s concurrency=%s`, this.pending.length, this.running.length, this.concurrency); - return; - } - const task = utils_1.append(this.running, this.pending.shift()); - this.logger(`Attempting id=%s`, task.id); - task.done(() => { - this.logger(`Completing id=`, task.id); - utils_1.remove(this.running, task); - this.schedule(); - }); - } - next() { - const { promise: promise2, id } = utils_1.append(this.pending, createScheduledTask()); - this.logger(`Scheduling id=%s`, id); - this.schedule(); - return promise2; - } - }; - exports.Scheduler = Scheduler; - } -}); - -// node_modules/simple-git/src/lib/tasks/apply-patch.js -var require_apply_patch = __commonJS({ - "node_modules/simple-git/src/lib/tasks/apply-patch.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.applyPatchTask = void 0; - var task_1 = require_task(); - function applyPatchTask(patches, customArgs) { - return task_1.straightThroughStringTask(["apply", ...customArgs, ...patches]); - } - exports.applyPatchTask = applyPatchTask; - } -}); - -// node_modules/simple-git/src/lib/responses/BranchDeleteSummary.js -var require_BranchDeleteSummary = __commonJS({ - "node_modules/simple-git/src/lib/responses/BranchDeleteSummary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isSingleBranchDeleteFailure = exports.branchDeletionFailure = exports.branchDeletionSuccess = exports.BranchDeletionBatch = void 0; - var BranchDeletionBatch = class { - constructor() { - this.all = []; - this.branches = {}; - this.errors = []; - } - get success() { - return !this.errors.length; - } - }; - exports.BranchDeletionBatch = BranchDeletionBatch; - function branchDeletionSuccess(branch, hash2) { - return { - branch, - hash: hash2, - success: true - }; - } - exports.branchDeletionSuccess = branchDeletionSuccess; - function branchDeletionFailure(branch) { - return { - branch, - hash: null, - success: false - }; - } - exports.branchDeletionFailure = branchDeletionFailure; - function isSingleBranchDeleteFailure(test) { - return test.success; - } - exports.isSingleBranchDeleteFailure = isSingleBranchDeleteFailure; - } -}); - -// node_modules/simple-git/src/lib/parsers/parse-branch-delete.js -var require_parse_branch_delete = __commonJS({ - "node_modules/simple-git/src/lib/parsers/parse-branch-delete.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.hasBranchDeletionError = exports.parseBranchDeletions = void 0; - var BranchDeleteSummary_1 = require_BranchDeleteSummary(); - var utils_1 = require_utils(); - var deleteSuccessRegex = /(\S+)\s+\(\S+\s([^)]+)\)/; - var deleteErrorRegex = /^error[^']+'([^']+)'/m; - var parsers = [ - new utils_1.LineParser(deleteSuccessRegex, (result, [branch, hash2]) => { - const deletion = BranchDeleteSummary_1.branchDeletionSuccess(branch, hash2); - result.all.push(deletion); - result.branches[branch] = deletion; - }), - new utils_1.LineParser(deleteErrorRegex, (result, [branch]) => { - const deletion = BranchDeleteSummary_1.branchDeletionFailure(branch); - result.errors.push(deletion); - result.all.push(deletion); - result.branches[branch] = deletion; - }) - ]; - var parseBranchDeletions = (stdOut, stdErr) => { - return utils_1.parseStringResponse(new BranchDeleteSummary_1.BranchDeletionBatch(), parsers, stdOut, stdErr); - }; - exports.parseBranchDeletions = parseBranchDeletions; - function hasBranchDeletionError(data, processExitCode) { - return processExitCode === utils_1.ExitCodes.ERROR && deleteErrorRegex.test(data); - } - exports.hasBranchDeletionError = hasBranchDeletionError; - } -}); - -// node_modules/simple-git/src/lib/responses/BranchSummary.js -var require_BranchSummary = __commonJS({ - "node_modules/simple-git/src/lib/responses/BranchSummary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.BranchSummaryResult = void 0; - var BranchSummaryResult = class { - constructor() { - this.all = []; - this.branches = {}; - this.current = ""; - this.detached = false; - } - push(current, detached, name, commit, label) { - if (current) { - this.detached = detached; - this.current = name; - } - this.all.push(name); - this.branches[name] = { - current, - name, - commit, - label - }; - } - }; - exports.BranchSummaryResult = BranchSummaryResult; - } -}); - -// node_modules/simple-git/src/lib/parsers/parse-branch.js -var require_parse_branch = __commonJS({ - "node_modules/simple-git/src/lib/parsers/parse-branch.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseBranchSummary = void 0; - var BranchSummary_1 = require_BranchSummary(); - var utils_1 = require_utils(); - var parsers = [ - new utils_1.LineParser(/^(\*\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/, (result, [current, name, commit, label]) => { - result.push(!!current, true, name, commit, label); - }), - new utils_1.LineParser(/^(\*\s)?(\S+)\s+([a-z0-9]+)\s(.*)$/s, (result, [current, name, commit, label]) => { - result.push(!!current, false, name, commit, label); - }) - ]; - function parseBranchSummary(stdOut) { - return utils_1.parseStringResponse(new BranchSummary_1.BranchSummaryResult(), parsers, stdOut); - } - exports.parseBranchSummary = parseBranchSummary; - } -}); - -// node_modules/simple-git/src/lib/tasks/branch.js -var require_branch = __commonJS({ - "node_modules/simple-git/src/lib/tasks/branch.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.deleteBranchTask = exports.deleteBranchesTask = exports.branchLocalTask = exports.branchTask = exports.containsDeleteBranchCommand = void 0; - var git_response_error_1 = require_git_response_error(); - var parse_branch_delete_1 = require_parse_branch_delete(); - var parse_branch_1 = require_parse_branch(); - var utils_1 = require_utils(); - function containsDeleteBranchCommand(commands) { - const deleteCommands = ["-d", "-D", "--delete"]; - return commands.some((command) => deleteCommands.includes(command)); - } - exports.containsDeleteBranchCommand = containsDeleteBranchCommand; - function branchTask(customArgs) { - const isDelete = containsDeleteBranchCommand(customArgs); - const commands = ["branch", ...customArgs]; - if (commands.length === 1) { - commands.push("-a"); - } - if (!commands.includes("-v")) { - commands.splice(1, 0, "-v"); - } - return { - format: "utf-8", - commands, - parser(stdOut, stdErr) { - if (isDelete) { - return parse_branch_delete_1.parseBranchDeletions(stdOut, stdErr).all[0]; - } - return parse_branch_1.parseBranchSummary(stdOut); - } - }; - } - exports.branchTask = branchTask; - function branchLocalTask() { - const parser = parse_branch_1.parseBranchSummary; - return { - format: "utf-8", - commands: ["branch", "-v"], - parser - }; - } - exports.branchLocalTask = branchLocalTask; - function deleteBranchesTask(branches, forceDelete = false) { - return { - format: "utf-8", - commands: ["branch", "-v", forceDelete ? "-D" : "-d", ...branches], - parser(stdOut, stdErr) { - return parse_branch_delete_1.parseBranchDeletions(stdOut, stdErr); - }, - onError({ exitCode, stdOut }, error, done, fail) { - if (!parse_branch_delete_1.hasBranchDeletionError(String(error), exitCode)) { - return fail(error); - } - done(stdOut); - } - }; - } - exports.deleteBranchesTask = deleteBranchesTask; - function deleteBranchTask(branch, forceDelete = false) { - const task = { - format: "utf-8", - commands: ["branch", "-v", forceDelete ? "-D" : "-d", branch], - parser(stdOut, stdErr) { - return parse_branch_delete_1.parseBranchDeletions(stdOut, stdErr).branches[branch]; - }, - onError({ exitCode, stdErr, stdOut }, error, _, fail) { - if (!parse_branch_delete_1.hasBranchDeletionError(String(error), exitCode)) { - return fail(error); - } - throw new git_response_error_1.GitResponseError(task.parser(utils_1.bufferToString(stdOut), utils_1.bufferToString(stdErr)), String(error)); - } - }; - return task; - } - exports.deleteBranchTask = deleteBranchTask; - } -}); - -// node_modules/simple-git/src/lib/responses/CheckIgnore.js -var require_CheckIgnore = __commonJS({ - "node_modules/simple-git/src/lib/responses/CheckIgnore.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseCheckIgnore = void 0; - var parseCheckIgnore = (text2) => { - return text2.split(/\n/g).map((line) => line.trim()).filter((file) => !!file); - }; - exports.parseCheckIgnore = parseCheckIgnore; - } -}); - -// node_modules/simple-git/src/lib/tasks/check-ignore.js -var require_check_ignore = __commonJS({ - "node_modules/simple-git/src/lib/tasks/check-ignore.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.checkIgnoreTask = void 0; - var CheckIgnore_1 = require_CheckIgnore(); - function checkIgnoreTask(paths) { - return { - commands: ["check-ignore", ...paths], - format: "utf-8", - parser: CheckIgnore_1.parseCheckIgnore - }; - } - exports.checkIgnoreTask = checkIgnoreTask; - } -}); - -// node_modules/simple-git/src/lib/tasks/clone.js -var require_clone = __commonJS({ - "node_modules/simple-git/src/lib/tasks/clone.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.cloneMirrorTask = exports.cloneTask = void 0; - var task_1 = require_task(); - var utils_1 = require_utils(); - function cloneTask(repo, directory, customArgs) { - const commands = ["clone", ...customArgs]; - if (typeof repo === "string") { - commands.push(repo); - } - if (typeof directory === "string") { - commands.push(directory); - } - return task_1.straightThroughStringTask(commands); - } - exports.cloneTask = cloneTask; - function cloneMirrorTask(repo, directory, customArgs) { - utils_1.append(customArgs, "--mirror"); - return cloneTask(repo, directory, customArgs); - } - exports.cloneMirrorTask = cloneMirrorTask; - } -}); - -// node_modules/simple-git/src/lib/parsers/parse-commit.js -var require_parse_commit = __commonJS({ - "node_modules/simple-git/src/lib/parsers/parse-commit.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseCommitResult = void 0; - var utils_1 = require_utils(); - var parsers = [ - new utils_1.LineParser(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/, (result, [branch, root, commit]) => { - result.branch = branch; - result.commit = commit; - result.root = !!root; - }), - new utils_1.LineParser(/\s*Author:\s(.+)/i, (result, [author]) => { - const parts = author.split("<"); - const email = parts.pop(); - if (!email || !email.includes("@")) { - return; - } - result.author = { - email: email.substr(0, email.length - 1), - name: parts.join("<").trim() - }; - }), - new utils_1.LineParser(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g, (result, [changes, insertions, deletions]) => { - result.summary.changes = parseInt(changes, 10) || 0; - result.summary.insertions = parseInt(insertions, 10) || 0; - result.summary.deletions = parseInt(deletions, 10) || 0; - }), - new utils_1.LineParser(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/, (result, [changes, lines, direction]) => { - result.summary.changes = parseInt(changes, 10) || 0; - const count = parseInt(lines, 10) || 0; - if (direction === "-") { - result.summary.deletions = count; - } else if (direction === "+") { - result.summary.insertions = count; - } - }) - ]; - function parseCommitResult(stdOut) { - const result = { - author: null, - branch: "", - commit: "", - root: false, - summary: { - changes: 0, - insertions: 0, - deletions: 0 - } - }; - return utils_1.parseStringResponse(result, parsers, stdOut); - } - exports.parseCommitResult = parseCommitResult; - } -}); - -// node_modules/simple-git/src/lib/tasks/commit.js -var require_commit = __commonJS({ - "node_modules/simple-git/src/lib/tasks/commit.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.commitTask = void 0; - var parse_commit_1 = require_parse_commit(); - function commitTask(message, files, customArgs) { - const commands = ["commit"]; - message.forEach((m) => commands.push("-m", m)); - commands.push(...files, ...customArgs); - return { - commands, - format: "utf-8", - parser: parse_commit_1.parseCommitResult - }; - } - exports.commitTask = commitTask; - } -}); - -// node_modules/simple-git/src/lib/tasks/diff.js -var require_diff = __commonJS({ - "node_modules/simple-git/src/lib/tasks/diff.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.diffSummaryTask = void 0; - var parse_diff_summary_1 = require_parse_diff_summary(); - function diffSummaryTask(customArgs) { - return { - commands: ["diff", "--stat=4096", ...customArgs], - format: "utf-8", - parser(stdOut) { - return parse_diff_summary_1.parseDiffResult(stdOut); - } - }; - } - exports.diffSummaryTask = diffSummaryTask; - } -}); - -// node_modules/simple-git/src/lib/parsers/parse-fetch.js -var require_parse_fetch = __commonJS({ - "node_modules/simple-git/src/lib/parsers/parse-fetch.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseFetchResult = void 0; - var utils_1 = require_utils(); - var parsers = [ - new utils_1.LineParser(/From (.+)$/, (result, [remote]) => { - result.remote = remote; - }), - new utils_1.LineParser(/\* \[new branch]\s+(\S+)\s*-> (.+)$/, (result, [name, tracking]) => { - result.branches.push({ - name, - tracking - }); - }), - new utils_1.LineParser(/\* \[new tag]\s+(\S+)\s*-> (.+)$/, (result, [name, tracking]) => { - result.tags.push({ - name, - tracking - }); - }) - ]; - function parseFetchResult(stdOut, stdErr) { - const result = { - raw: stdOut, - remote: null, - branches: [], - tags: [] - }; - return utils_1.parseStringResponse(result, parsers, stdOut, stdErr); - } - exports.parseFetchResult = parseFetchResult; - } -}); - -// node_modules/simple-git/src/lib/tasks/fetch.js -var require_fetch = __commonJS({ - "node_modules/simple-git/src/lib/tasks/fetch.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fetchTask = void 0; - var parse_fetch_1 = require_parse_fetch(); - function fetchTask(remote, branch, customArgs) { - const commands = ["fetch", ...customArgs]; - if (remote && branch) { - commands.push(remote, branch); - } - return { - commands, - format: "utf-8", - parser: parse_fetch_1.parseFetchResult - }; - } - exports.fetchTask = fetchTask; - } -}); - -// node_modules/simple-git/src/lib/parsers/parse-move.js -var require_parse_move = __commonJS({ - "node_modules/simple-git/src/lib/parsers/parse-move.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseMoveResult = void 0; - var utils_1 = require_utils(); - var parsers = [ - new utils_1.LineParser(/^Renaming (.+) to (.+)$/, (result, [from, to]) => { - result.moves.push({ from, to }); - }) - ]; - function parseMoveResult(stdOut) { - return utils_1.parseStringResponse({ moves: [] }, parsers, stdOut); - } - exports.parseMoveResult = parseMoveResult; - } -}); - -// node_modules/simple-git/src/lib/tasks/move.js -var require_move = __commonJS({ - "node_modules/simple-git/src/lib/tasks/move.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.moveTask = void 0; - var parse_move_1 = require_parse_move(); - var utils_1 = require_utils(); - function moveTask(from, to) { - return { - commands: ["mv", "-v", ...utils_1.asArray(from), to], - format: "utf-8", - parser: parse_move_1.parseMoveResult - }; - } - exports.moveTask = moveTask; - } -}); - -// node_modules/simple-git/src/lib/tasks/pull.js -var require_pull = __commonJS({ - "node_modules/simple-git/src/lib/tasks/pull.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.pullTask = void 0; - var parse_pull_1 = require_parse_pull(); - function pullTask(remote, branch, customArgs) { - const commands = ["pull", ...customArgs]; - if (remote && branch) { - commands.splice(1, 0, remote, branch); - } - return { - commands, - format: "utf-8", - parser(stdOut, stdErr) { - return parse_pull_1.parsePullResult(stdOut, stdErr); - } - }; - } - exports.pullTask = pullTask; - } -}); - -// node_modules/simple-git/src/lib/responses/GetRemoteSummary.js -var require_GetRemoteSummary = __commonJS({ - "node_modules/simple-git/src/lib/responses/GetRemoteSummary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseGetRemotesVerbose = exports.parseGetRemotes = void 0; - var utils_1 = require_utils(); - function parseGetRemotes(text2) { - const remotes = {}; - forEach(text2, ([name]) => remotes[name] = { name }); - return Object.values(remotes); - } - exports.parseGetRemotes = parseGetRemotes; - function parseGetRemotesVerbose(text2) { - const remotes = {}; - forEach(text2, ([name, url, purpose]) => { - if (!remotes.hasOwnProperty(name)) { - remotes[name] = { - name, - refs: { fetch: "", push: "" } - }; - } - if (purpose && url) { - remotes[name].refs[purpose.replace(/[^a-z]/g, "")] = url; - } - }); - return Object.values(remotes); - } - exports.parseGetRemotesVerbose = parseGetRemotesVerbose; - function forEach(text2, handler) { - utils_1.forEachLineWithContent(text2, (line) => handler(line.split(/\s+/))); - } - } -}); - -// node_modules/simple-git/src/lib/tasks/remote.js -var require_remote = __commonJS({ - "node_modules/simple-git/src/lib/tasks/remote.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.removeRemoteTask = exports.remoteTask = exports.listRemotesTask = exports.getRemotesTask = exports.addRemoteTask = void 0; - var GetRemoteSummary_1 = require_GetRemoteSummary(); - var task_1 = require_task(); - function addRemoteTask(remoteName, remoteRepo, customArgs = []) { - return task_1.straightThroughStringTask(["remote", "add", ...customArgs, remoteName, remoteRepo]); - } - exports.addRemoteTask = addRemoteTask; - function getRemotesTask(verbose) { - const commands = ["remote"]; - if (verbose) { - commands.push("-v"); - } - return { - commands, - format: "utf-8", - parser: verbose ? GetRemoteSummary_1.parseGetRemotesVerbose : GetRemoteSummary_1.parseGetRemotes - }; - } - exports.getRemotesTask = getRemotesTask; - function listRemotesTask(customArgs = []) { - const commands = [...customArgs]; - if (commands[0] !== "ls-remote") { - commands.unshift("ls-remote"); - } - return task_1.straightThroughStringTask(commands); - } - exports.listRemotesTask = listRemotesTask; - function remoteTask(customArgs = []) { - const commands = [...customArgs]; - if (commands[0] !== "remote") { - commands.unshift("remote"); - } - return task_1.straightThroughStringTask(commands); - } - exports.remoteTask = remoteTask; - function removeRemoteTask(remoteName) { - return task_1.straightThroughStringTask(["remote", "remove", remoteName]); - } - exports.removeRemoteTask = removeRemoteTask; - } -}); - -// node_modules/simple-git/src/lib/tasks/stash-list.js -var require_stash_list = __commonJS({ - "node_modules/simple-git/src/lib/tasks/stash-list.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.stashListTask = void 0; - var parse_list_log_summary_1 = require_parse_list_log_summary(); - var log_1 = require_log(); - function stashListTask(opt = {}, customArgs) { - const options = log_1.parseLogOptions(opt); - const parser = parse_list_log_summary_1.createListLogSummaryParser(options.splitter, options.fields); - return { - commands: ["stash", "list", ...options.commands, ...customArgs], - format: "utf-8", - parser - }; - } - exports.stashListTask = stashListTask; - } -}); - -// node_modules/simple-git/src/lib/tasks/sub-module.js -var require_sub_module = __commonJS({ - "node_modules/simple-git/src/lib/tasks/sub-module.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.updateSubModuleTask = exports.subModuleTask = exports.initSubModuleTask = exports.addSubModuleTask = void 0; - var task_1 = require_task(); - function addSubModuleTask(repo, path3) { - return subModuleTask(["add", repo, path3]); - } - exports.addSubModuleTask = addSubModuleTask; - function initSubModuleTask(customArgs) { - return subModuleTask(["init", ...customArgs]); - } - exports.initSubModuleTask = initSubModuleTask; - function subModuleTask(customArgs) { - const commands = [...customArgs]; - if (commands[0] !== "submodule") { - commands.unshift("submodule"); - } - return task_1.straightThroughStringTask(commands); - } - exports.subModuleTask = subModuleTask; - function updateSubModuleTask(customArgs) { - return subModuleTask(["update", ...customArgs]); - } - exports.updateSubModuleTask = updateSubModuleTask; - } -}); - -// node_modules/simple-git/src/lib/responses/TagList.js -var require_TagList = __commonJS({ - "node_modules/simple-git/src/lib/responses/TagList.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseTagList = exports.TagList = void 0; - var TagList = class { - constructor(all, latest) { - this.all = all; - this.latest = latest; - } - }; - exports.TagList = TagList; - var parseTagList = function(data, customSort = false) { - const tags = data.split("\n").map(trimmed).filter(Boolean); - if (!customSort) { - tags.sort(function(tagA, tagB) { - const partsA = tagA.split("."); - const partsB = tagB.split("."); - if (partsA.length === 1 || partsB.length === 1) { - return singleSorted(toNumber(partsA[0]), toNumber(partsB[0])); - } - for (let i = 0, l = Math.max(partsA.length, partsB.length); i < l; i++) { - const diff = sorted(toNumber(partsA[i]), toNumber(partsB[i])); - if (diff) { - return diff; - } - } - return 0; - }); - } - const latest = customSort ? tags[0] : [...tags].reverse().find((tag) => tag.indexOf(".") >= 0); - return new TagList(tags, latest); - }; - exports.parseTagList = parseTagList; - function singleSorted(a, b) { - const aIsNum = isNaN(a); - const bIsNum = isNaN(b); - if (aIsNum !== bIsNum) { - return aIsNum ? 1 : -1; - } - return aIsNum ? sorted(a, b) : 0; - } - function sorted(a, b) { - return a === b ? 0 : a > b ? 1 : -1; - } - function trimmed(input) { - return input.trim(); - } - function toNumber(input) { - if (typeof input === "string") { - return parseInt(input.replace(/^\D+/g, ""), 10) || 0; - } - return 0; - } - } -}); - -// node_modules/simple-git/src/lib/tasks/tag.js -var require_tag = __commonJS({ - "node_modules/simple-git/src/lib/tasks/tag.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.addAnnotatedTagTask = exports.addTagTask = exports.tagListTask = void 0; - var TagList_1 = require_TagList(); - function tagListTask(customArgs = []) { - const hasCustomSort = customArgs.some((option) => /^--sort=/.test(option)); - return { - format: "utf-8", - commands: ["tag", "-l", ...customArgs], - parser(text2) { - return TagList_1.parseTagList(text2, hasCustomSort); - } - }; - } - exports.tagListTask = tagListTask; - function addTagTask(name) { - return { - format: "utf-8", - commands: ["tag", name], - parser() { - return { name }; - } - }; - } - exports.addTagTask = addTagTask; - function addAnnotatedTagTask(name, tagMessage) { - return { - format: "utf-8", - commands: ["tag", "-a", "-m", tagMessage, name], - parser() { - return { name }; - } - }; - } - exports.addAnnotatedTagTask = addAnnotatedTagTask; - } -}); - -// node_modules/simple-git/src/git.js -var require_git = __commonJS({ - "node_modules/simple-git/src/git.js"(exports, module2) { - var { GitExecutor } = require_git_executor(); - var { SimpleGitApi } = require_simple_git_api(); - var { Scheduler } = require_scheduler(); - var { GitLogger } = require_git_logger(); - var { configurationErrorTask } = require_task(); - var { - asArray, - filterArray, - filterPrimitives, - filterString, - filterStringOrStringArray, - filterType, - getTrailingOptions, - trailingFunctionArgument, - trailingOptionsArgument - } = require_utils(); - var { applyPatchTask } = require_apply_patch(); - var { branchTask, branchLocalTask, deleteBranchesTask, deleteBranchTask } = require_branch(); - var { checkIgnoreTask } = require_check_ignore(); - var { checkIsRepoTask } = require_check_is_repo(); - var { cloneTask, cloneMirrorTask } = require_clone(); - var { cleanWithOptionsTask, isCleanOptionsArray } = require_clean(); - var { commitTask } = require_commit(); - var { diffSummaryTask } = require_diff(); - var { fetchTask } = require_fetch(); - var { moveTask } = require_move(); - var { pullTask } = require_pull(); - var { pushTagsTask } = require_push(); - var { addRemoteTask, getRemotesTask, listRemotesTask, remoteTask, removeRemoteTask } = require_remote(); - var { getResetMode, resetTask } = require_reset(); - var { stashListTask } = require_stash_list(); - var { addSubModuleTask, initSubModuleTask, subModuleTask, updateSubModuleTask } = require_sub_module(); - var { addAnnotatedTagTask, addTagTask, tagListTask } = require_tag(); - var { straightThroughBufferTask, straightThroughStringTask } = require_task(); - function Git(options, plugins) { - this._executor = new GitExecutor(options.binary, options.baseDir, new Scheduler(options.maxConcurrentProcesses), plugins); - this._logger = new GitLogger(); - } - (Git.prototype = Object.create(SimpleGitApi.prototype)).constructor = Git; - Git.prototype._logger = null; - Git.prototype.customBinary = function(command) { - this._executor.binary = command; - return this; - }; - Git.prototype.env = function(name, value) { - if (arguments.length === 1 && typeof name === "object") { - this._executor.env = name; - } else { - (this._executor.env = this._executor.env || {})[name] = value; - } - return this; - }; - Git.prototype.stashList = function(options) { - return this._runTask(stashListTask(trailingOptionsArgument(arguments) || {}, filterArray(options) && options || []), trailingFunctionArgument(arguments)); - }; - function createCloneTask(api, task, repoPath, localPath) { - if (typeof repoPath !== "string") { - return configurationErrorTask(`git.${api}() requires a string 'repoPath'`); - } - return task(repoPath, filterType(localPath, filterString), getTrailingOptions(arguments)); - } - Git.prototype.clone = function() { - return this._runTask(createCloneTask("clone", cloneTask, ...arguments), trailingFunctionArgument(arguments)); - }; - Git.prototype.mirror = function() { - return this._runTask(createCloneTask("mirror", cloneMirrorTask, ...arguments), trailingFunctionArgument(arguments)); - }; - Git.prototype.mv = function(from, to) { - return this._runTask(moveTask(from, to), trailingFunctionArgument(arguments)); - }; - Git.prototype.checkoutLatestTag = function(then) { - var git = this; - return this.pull(function() { - git.tags(function(err, tags) { - git.checkout(tags.latest, then); - }); - }); - }; - Git.prototype.commit = function(message, files, options, then) { - const next = trailingFunctionArgument(arguments); - const messages = []; - if (filterStringOrStringArray(message)) { - messages.push(...asArray(message)); - } else { - console.warn("simple-git deprecation notice: git.commit: requires the commit message to be supplied as a string/string[], this will be an error in version 3"); - } - return this._runTask(commitTask(messages, asArray(filterType(files, filterStringOrStringArray, [])), [...filterType(options, filterArray, []), ...getTrailingOptions(arguments, 0, true)]), next); - }; - Git.prototype.pull = function(remote, branch, options, then) { - return this._runTask(pullTask(filterType(remote, filterString), filterType(branch, filterString), getTrailingOptions(arguments)), trailingFunctionArgument(arguments)); - }; - Git.prototype.fetch = function(remote, branch) { - return this._runTask(fetchTask(filterType(remote, filterString), filterType(branch, filterString), getTrailingOptions(arguments)), trailingFunctionArgument(arguments)); - }; - Git.prototype.silent = function(silence) { - console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"); - this._logger.silent(!!silence); - return this; - }; - Git.prototype.tags = function(options, then) { - return this._runTask(tagListTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments)); - }; - Git.prototype.rebase = function() { - return this._runTask(straightThroughStringTask(["rebase", ...getTrailingOptions(arguments)]), trailingFunctionArgument(arguments)); - }; - Git.prototype.reset = function(mode) { - return this._runTask(resetTask(getResetMode(mode), getTrailingOptions(arguments)), trailingFunctionArgument(arguments)); - }; - Git.prototype.revert = function(commit) { - const next = trailingFunctionArgument(arguments); - if (typeof commit !== "string") { - return this._runTask(configurationErrorTask("Commit must be a string"), next); - } - return this._runTask(straightThroughStringTask(["revert", ...getTrailingOptions(arguments, 0, true), commit]), next); - }; - Git.prototype.addTag = function(name) { - const task = typeof name === "string" ? addTagTask(name) : configurationErrorTask("Git.addTag requires a tag name"); - return this._runTask(task, trailingFunctionArgument(arguments)); - }; - Git.prototype.addAnnotatedTag = function(tagName, tagMessage) { - return this._runTask(addAnnotatedTagTask(tagName, tagMessage), trailingFunctionArgument(arguments)); - }; - Git.prototype.checkout = function() { - const commands = ["checkout", ...getTrailingOptions(arguments, true)]; - return this._runTask(straightThroughStringTask(commands), trailingFunctionArgument(arguments)); - }; - Git.prototype.checkoutBranch = function(branchName, startPoint, then) { - return this.checkout(["-b", branchName, startPoint], trailingFunctionArgument(arguments)); - }; - Git.prototype.checkoutLocalBranch = function(branchName, then) { - return this.checkout(["-b", branchName], trailingFunctionArgument(arguments)); - }; - Git.prototype.deleteLocalBranch = function(branchName, forceDelete, then) { - return this._runTask(deleteBranchTask(branchName, typeof forceDelete === "boolean" ? forceDelete : false), trailingFunctionArgument(arguments)); - }; - Git.prototype.deleteLocalBranches = function(branchNames, forceDelete, then) { - return this._runTask(deleteBranchesTask(branchNames, typeof forceDelete === "boolean" ? forceDelete : false), trailingFunctionArgument(arguments)); - }; - Git.prototype.branch = function(options, then) { - return this._runTask(branchTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments)); - }; - Git.prototype.branchLocal = function(then) { - return this._runTask(branchLocalTask(), trailingFunctionArgument(arguments)); - }; - Git.prototype.raw = function(commands) { - const createRestCommands = !Array.isArray(commands); - const command = [].slice.call(createRestCommands ? arguments : commands, 0); - for (let i = 0; i < command.length && createRestCommands; i++) { - if (!filterPrimitives(command[i])) { - command.splice(i, command.length - i); - break; - } - } - command.push(...getTrailingOptions(arguments, 0, true)); - var next = trailingFunctionArgument(arguments); - if (!command.length) { - return this._runTask(configurationErrorTask("Raw: must supply one or more command to execute"), next); - } - return this._runTask(straightThroughStringTask(command), next); - }; - Git.prototype.submoduleAdd = function(repo, path3, then) { - return this._runTask(addSubModuleTask(repo, path3), trailingFunctionArgument(arguments)); - }; - Git.prototype.submoduleUpdate = function(args, then) { - return this._runTask(updateSubModuleTask(getTrailingOptions(arguments, true)), trailingFunctionArgument(arguments)); - }; - Git.prototype.submoduleInit = function(args, then) { - return this._runTask(initSubModuleTask(getTrailingOptions(arguments, true)), trailingFunctionArgument(arguments)); - }; - Git.prototype.subModule = function(options, then) { - return this._runTask(subModuleTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments)); - }; - Git.prototype.listRemote = function() { - return this._runTask(listRemotesTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments)); - }; - Git.prototype.addRemote = function(remoteName, remoteRepo, then) { - return this._runTask(addRemoteTask(remoteName, remoteRepo, getTrailingOptions(arguments)), trailingFunctionArgument(arguments)); - }; - Git.prototype.removeRemote = function(remoteName, then) { - return this._runTask(removeRemoteTask(remoteName), trailingFunctionArgument(arguments)); - }; - Git.prototype.getRemotes = function(verbose, then) { - return this._runTask(getRemotesTask(verbose === true), trailingFunctionArgument(arguments)); - }; - Git.prototype.remote = function(options, then) { - return this._runTask(remoteTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments)); - }; - Git.prototype.tag = function(options, then) { - const command = getTrailingOptions(arguments); - if (command[0] !== "tag") { - command.unshift("tag"); - } - return this._runTask(straightThroughStringTask(command), trailingFunctionArgument(arguments)); - }; - Git.prototype.updateServerInfo = function(then) { - return this._runTask(straightThroughStringTask(["update-server-info"]), trailingFunctionArgument(arguments)); - }; - Git.prototype.pushTags = function(remote, then) { - const task = pushTagsTask({ remote: filterType(remote, filterString) }, getTrailingOptions(arguments)); - return this._runTask(task, trailingFunctionArgument(arguments)); - }; - Git.prototype.rm = function(files) { - return this._runTask(straightThroughStringTask(["rm", "-f", ...asArray(files)]), trailingFunctionArgument(arguments)); - }; - Git.prototype.rmKeepLocal = function(files) { - return this._runTask(straightThroughStringTask(["rm", "--cached", ...asArray(files)]), trailingFunctionArgument(arguments)); - }; - Git.prototype.catFile = function(options, then) { - return this._catFile("utf-8", arguments); - }; - Git.prototype.binaryCatFile = function() { - return this._catFile("buffer", arguments); - }; - Git.prototype._catFile = function(format, args) { - var handler = trailingFunctionArgument(args); - var command = ["cat-file"]; - var options = args[0]; - if (typeof options === "string") { - return this._runTask(configurationErrorTask("Git.catFile: options must be supplied as an array of strings"), handler); - } - if (Array.isArray(options)) { - command.push.apply(command, options); - } - const task = format === "buffer" ? straightThroughBufferTask(command) : straightThroughStringTask(command); - return this._runTask(task, handler); - }; - Git.prototype.diff = function(options, then) { - const command = ["diff", ...getTrailingOptions(arguments)]; - if (typeof options === "string") { - command.splice(1, 0, options); - this._logger.warn("Git#diff: supplying options as a single string is now deprecated, switch to an array of strings"); - } - return this._runTask(straightThroughStringTask(command), trailingFunctionArgument(arguments)); - }; - Git.prototype.diffSummary = function() { - return this._runTask(diffSummaryTask(getTrailingOptions(arguments, 1)), trailingFunctionArgument(arguments)); - }; - Git.prototype.applyPatch = function(patches) { - const task = !filterStringOrStringArray(patches) ? configurationErrorTask(`git.applyPatch requires one or more string patches as the first argument`) : applyPatchTask(asArray(patches), getTrailingOptions([].slice.call(arguments, 1))); - return this._runTask(task, trailingFunctionArgument(arguments)); - }; - Git.prototype.revparse = function() { - const commands = ["rev-parse", ...getTrailingOptions(arguments, true)]; - return this._runTask(straightThroughStringTask(commands, true), trailingFunctionArgument(arguments)); - }; - Git.prototype.show = function(options, then) { - return this._runTask(straightThroughStringTask(["show", ...getTrailingOptions(arguments, 1)]), trailingFunctionArgument(arguments)); - }; - Git.prototype.clean = function(mode, options, then) { - const usingCleanOptionsArray = isCleanOptionsArray(mode); - const cleanMode = usingCleanOptionsArray && mode.join("") || filterType(mode, filterString) || ""; - const customArgs = getTrailingOptions([].slice.call(arguments, usingCleanOptionsArray ? 1 : 0)); - return this._runTask(cleanWithOptionsTask(cleanMode, customArgs), trailingFunctionArgument(arguments)); - }; - Git.prototype.exec = function(then) { - const task = { - commands: [], - format: "utf-8", - parser() { - if (typeof then === "function") { - then(); - } - } - }; - return this._runTask(task); - }; - Git.prototype.clearQueue = function() { - return this; - }; - Git.prototype.checkIgnore = function(pathnames, then) { - return this._runTask(checkIgnoreTask(asArray(filterType(pathnames, filterStringOrStringArray, []))), trailingFunctionArgument(arguments)); - }; - Git.prototype.checkIsRepo = function(checkType, then) { - return this._runTask(checkIsRepoTask(filterType(checkType, filterString)), trailingFunctionArgument(arguments)); - }; - module2.exports = Git; - } -}); - -// node_modules/simple-git/src/lib/git-factory.js -var require_git_factory = __commonJS({ - "node_modules/simple-git/src/lib/git-factory.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.gitInstanceFactory = exports.gitExportFactory = exports.esModuleFactory = void 0; - var api_1 = require_api(); - var plugins_1 = require_plugins(); - var utils_1 = require_utils(); - var Git = require_git(); - function esModuleFactory(defaultExport) { - return Object.defineProperties(defaultExport, { - __esModule: { value: true }, - default: { value: defaultExport } - }); - } - exports.esModuleFactory = esModuleFactory; - function gitExportFactory(factory, extra) { - return Object.assign(function(...args) { - return factory.apply(null, args); - }, api_1.default, extra || {}); - } - exports.gitExportFactory = gitExportFactory; - function gitInstanceFactory(baseDir, options) { - const plugins = new plugins_1.PluginStore(); - const config = utils_1.createInstanceConfig(baseDir && (typeof baseDir === "string" ? { baseDir } : baseDir) || {}, options); - if (!utils_1.folderExists(config.baseDir)) { - throw new api_1.default.GitConstructError(config, `Cannot use simple-git on a directory that does not exist`); - } - if (Array.isArray(config.config)) { - plugins.add(plugins_1.commandConfigPrefixingPlugin(config.config)); - } - plugins.add(plugins_1.completionDetectionPlugin(config.completion)); - config.progress && plugins.add(plugins_1.progressMonitorPlugin(config.progress)); - config.timeout && plugins.add(plugins_1.timeoutPlugin(config.timeout)); - config.spawnOptions && plugins.add(plugins_1.spawnOptionsPlugin(config.spawnOptions)); - plugins.add(plugins_1.errorDetectionPlugin(plugins_1.errorDetectionHandler(true))); - config.errors && plugins.add(plugins_1.errorDetectionPlugin(config.errors)); - return new Git(config, plugins); - } - exports.gitInstanceFactory = gitInstanceFactory; - } -}); - -// node_modules/simple-git/src/lib/runners/promise-wrapped.js -var require_promise_wrapped = __commonJS({ - "node_modules/simple-git/src/lib/runners/promise-wrapped.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.gitP = void 0; - var git_response_error_1 = require_git_response_error(); - var git_factory_1 = require_git_factory(); - var functionNamesBuilderApi = [ - "customBinary", - "env", - "outputHandler", - "silent" - ]; - var functionNamesPromiseApi = [ - "add", - "addAnnotatedTag", - "addConfig", - "addRemote", - "addTag", - "applyPatch", - "binaryCatFile", - "branch", - "branchLocal", - "catFile", - "checkIgnore", - "checkIsRepo", - "checkout", - "checkoutBranch", - "checkoutLatestTag", - "checkoutLocalBranch", - "clean", - "clone", - "commit", - "cwd", - "deleteLocalBranch", - "deleteLocalBranches", - "diff", - "diffSummary", - "exec", - "fetch", - "getRemotes", - "init", - "listConfig", - "listRemote", - "log", - "merge", - "mergeFromTo", - "mirror", - "mv", - "pull", - "push", - "pushTags", - "raw", - "rebase", - "remote", - "removeRemote", - "reset", - "revert", - "revparse", - "rm", - "rmKeepLocal", - "show", - "stash", - "stashList", - "status", - "subModule", - "submoduleAdd", - "submoduleInit", - "submoduleUpdate", - "tag", - "tags", - "updateServerInfo" - ]; - function gitP(...args) { - let git; - let chain = Promise.resolve(); - try { - git = git_factory_1.gitInstanceFactory(...args); - } catch (e) { - chain = Promise.reject(e); - } - function builderReturn() { - return promiseApi; - } - function chainReturn() { - return chain; - } - const promiseApi = [...functionNamesBuilderApi, ...functionNamesPromiseApi].reduce((api, name) => { - const isAsync = functionNamesPromiseApi.includes(name); - const valid = isAsync ? asyncWrapper(name, git) : syncWrapper(name, git, api); - const alternative = isAsync ? chainReturn : builderReturn; - Object.defineProperty(api, name, { - enumerable: false, - configurable: false, - value: git ? valid : alternative - }); - return api; - }, {}); - return promiseApi; - function asyncWrapper(fn, git2) { - return function(...args2) { - if (typeof args2[args2.length] === "function") { - throw new TypeError("Promise interface requires that handlers are not supplied inline, trailing function not allowed in call to " + fn); - } - return chain.then(function() { - return new Promise(function(resolve, reject) { - const callback = (err, result) => { - if (err) { - return reject(toError(err)); - } - resolve(result); - }; - args2.push(callback); - git2[fn].apply(git2, args2); - }); - }); - }; - } - function syncWrapper(fn, git2, api) { - return (...args2) => { - git2[fn](...args2); - return api; - }; - } - } - exports.gitP = gitP; - function toError(error) { - if (error instanceof Error) { - return error; - } - if (typeof error === "string") { - return new Error(error); - } - return new git_response_error_1.GitResponseError(error); - } - } -}); - -// node_modules/simple-git/src/index.js -var require_src3 = __commonJS({ - "node_modules/simple-git/src/index.js"(exports, module2) { - var { gitP } = require_promise_wrapped(); - var { esModuleFactory, gitInstanceFactory, gitExportFactory } = require_git_factory(); - module2.exports = esModuleFactory(gitExportFactory(gitInstanceFactory, { gitP })); - } -}); - -// node_modules/diff2html/lib/types.js -var require_types = __commonJS({ - "node_modules/diff2html/lib/types.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DiffStyleType = exports.LineMatchingType = exports.OutputFormatType = exports.LineType = void 0; - var LineType; - (function(LineType2) { - LineType2["INSERT"] = "insert"; - LineType2["DELETE"] = "delete"; - LineType2["CONTEXT"] = "context"; - })(LineType = exports.LineType || (exports.LineType = {})); - exports.OutputFormatType = { - LINE_BY_LINE: "line-by-line", - SIDE_BY_SIDE: "side-by-side" - }; - exports.LineMatchingType = { - LINES: "lines", - WORDS: "words", - NONE: "none" - }; - exports.DiffStyleType = { - WORD: "word", - CHAR: "char" - }; - } -}); - -// node_modules/diff2html/lib/utils.js -var require_utils2 = __commonJS({ - "node_modules/diff2html/lib/utils.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.hashCode = exports.unifyPath = exports.escapeForRegExp = void 0; - var specials = [ - "-", - "[", - "]", - "/", - "{", - "}", - "(", - ")", - "*", - "+", - "?", - ".", - "\\", - "^", - "$", - "|" - ]; - var regex = RegExp("[" + specials.join("\\") + "]", "g"); - function escapeForRegExp(str) { - return str.replace(regex, "\\$&"); - } - exports.escapeForRegExp = escapeForRegExp; - function unifyPath(path3) { - return path3 ? path3.replace(/\\/g, "/") : path3; - } - exports.unifyPath = unifyPath; - function hashCode(text2) { - var i, chr, len; - var hash2 = 0; - for (i = 0, len = text2.length; i < len; i++) { - chr = text2.charCodeAt(i); - hash2 = (hash2 << 5) - hash2 + chr; - hash2 |= 0; - } - return hash2; - } - exports.hashCode = hashCode; - } -}); - -// node_modules/diff2html/lib/diff-parser.js -var require_diff_parser = __commonJS({ - "node_modules/diff2html/lib/diff-parser.js"(exports) { - "use strict"; - var __spreadArray2 = exports && exports.__spreadArray || function(to, from, pack) { - if (pack || arguments.length === 2) - for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) - ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parse = void 0; - var types_1 = require_types(); - var utils_1 = require_utils2(); - function getExtension(filename, language) { - var filenameParts = filename.split("."); - return filenameParts.length > 1 ? filenameParts[filenameParts.length - 1] : language; - } - function startsWithAny(str, prefixes) { - return prefixes.reduce(function(startsWith, prefix) { - return startsWith || str.startsWith(prefix); - }, false); - } - var baseDiffFilenamePrefixes = ["a/", "b/", "i/", "w/", "c/", "o/"]; - function getFilename(line, linePrefix, extraPrefix) { - var prefixes = extraPrefix !== void 0 ? __spreadArray2(__spreadArray2([], baseDiffFilenamePrefixes, true), [extraPrefix], false) : baseDiffFilenamePrefixes; - var FilenameRegExp = linePrefix ? new RegExp("^" + (0, utils_1.escapeForRegExp)(linePrefix) + ' "?(.+?)"?$') : new RegExp('^"?(.+?)"?$'); - var _a = FilenameRegExp.exec(line) || [], _b = _a[1], filename = _b === void 0 ? "" : _b; - var matchingPrefix = prefixes.find(function(p) { - return filename.indexOf(p) === 0; - }); - var fnameWithoutPrefix = matchingPrefix ? filename.slice(matchingPrefix.length) : filename; - return fnameWithoutPrefix.replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/, ""); - } - function getSrcFilename(line, srcPrefix) { - return getFilename(line, "---", srcPrefix); - } - function getDstFilename(line, dstPrefix) { - return getFilename(line, "+++", dstPrefix); - } - function parse(diffInput, config) { - if (config === void 0) { - config = {}; - } - var files = []; - var currentFile = null; - var currentBlock = null; - var oldLine = null; - var oldLine2 = null; - var newLine = null; - var possibleOldName = null; - var possibleNewName = null; - var oldFileNameHeader = "--- "; - var newFileNameHeader = "+++ "; - var hunkHeaderPrefix = "@@"; - var oldMode = /^old mode (\d{6})/; - var newMode = /^new mode (\d{6})/; - var deletedFileMode = /^deleted file mode (\d{6})/; - var newFileMode = /^new file mode (\d{6})/; - var copyFrom = /^copy from "?(.+)"?/; - var copyTo = /^copy to "?(.+)"?/; - var renameFrom = /^rename from "?(.+)"?/; - var renameTo = /^rename to "?(.+)"?/; - var similarityIndex = /^similarity index (\d+)%/; - var dissimilarityIndex = /^dissimilarity index (\d+)%/; - var index = /^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/; - var binaryFiles = /^Binary files (.*) and (.*) differ/; - var binaryDiff = /^GIT binary patch/; - var combinedIndex = /^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/; - var combinedMode = /^mode (\d{6}),(\d{6})\.\.(\d{6})/; - var combinedNewFile = /^new file mode (\d{6})/; - var combinedDeletedFile = /^deleted file mode (\d{6}),(\d{6})/; - var diffLines = diffInput.replace(/\\ No newline at end of file/g, "").replace(/\r\n?/g, "\n").split("\n"); - function saveBlock() { - if (currentBlock !== null && currentFile !== null) { - currentFile.blocks.push(currentBlock); - currentBlock = null; - } - } - function saveFile() { - if (currentFile !== null) { - if (!currentFile.oldName && possibleOldName !== null) { - currentFile.oldName = possibleOldName; - } - if (!currentFile.newName && possibleNewName !== null) { - currentFile.newName = possibleNewName; - } - if (currentFile.newName) { - files.push(currentFile); - currentFile = null; - } - } - possibleOldName = null; - possibleNewName = null; - } - function startFile() { - saveBlock(); - saveFile(); - currentFile = { - blocks: [], - deletedLines: 0, - addedLines: 0 - }; - } - function startBlock(line) { - saveBlock(); - var values; - if (currentFile !== null) { - if (values = /^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(line)) { - currentFile.isCombined = false; - oldLine = parseInt(values[1], 10); - newLine = parseInt(values[2], 10); - } else if (values = /^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(line)) { - currentFile.isCombined = true; - oldLine = parseInt(values[1], 10); - oldLine2 = parseInt(values[2], 10); - newLine = parseInt(values[3], 10); - } else { - if (line.startsWith(hunkHeaderPrefix)) { - console.error("Failed to parse lines, starting in 0!"); - } - oldLine = 0; - newLine = 0; - currentFile.isCombined = false; - } - } - currentBlock = { - lines: [], - oldStartLine: oldLine, - oldStartLine2: oldLine2, - newStartLine: newLine, - header: line - }; - } - function createLine(line) { - if (currentFile === null || currentBlock === null || oldLine === null || newLine === null) - return; - var currentLine = { - content: line - }; - var addedPrefixes = currentFile.isCombined ? ["+ ", " +", "++"] : ["+"]; - var deletedPrefixes = currentFile.isCombined ? ["- ", " -", "--"] : ["-"]; - if (startsWithAny(line, addedPrefixes)) { - currentFile.addedLines++; - currentLine.type = types_1.LineType.INSERT; - currentLine.oldNumber = void 0; - currentLine.newNumber = newLine++; - } else if (startsWithAny(line, deletedPrefixes)) { - currentFile.deletedLines++; - currentLine.type = types_1.LineType.DELETE; - currentLine.oldNumber = oldLine++; - currentLine.newNumber = void 0; - } else { - currentLine.type = types_1.LineType.CONTEXT; - currentLine.oldNumber = oldLine++; - currentLine.newNumber = newLine++; - } - currentBlock.lines.push(currentLine); - } - function existHunkHeader(line, lineIdx) { - var idx = lineIdx; - while (idx < diffLines.length - 3) { - if (line.startsWith("diff")) { - return false; - } - if (diffLines[idx].startsWith(oldFileNameHeader) && diffLines[idx + 1].startsWith(newFileNameHeader) && diffLines[idx + 2].startsWith(hunkHeaderPrefix)) { - return true; - } - idx++; - } - return false; - } - diffLines.forEach(function(line, lineIndex) { - if (!line || line.startsWith("*")) { - return; - } - var values; - var prevLine = diffLines[lineIndex - 1]; - var nxtLine = diffLines[lineIndex + 1]; - var afterNxtLine = diffLines[lineIndex + 2]; - if (line.startsWith("diff")) { - startFile(); - var gitDiffStart = /^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/; - if (values = gitDiffStart.exec(line)) { - possibleOldName = getFilename(values[1], void 0, config.dstPrefix); - possibleNewName = getFilename(values[2], void 0, config.srcPrefix); - } - if (currentFile === null) { - throw new Error("Where is my file !!!"); - } - currentFile.isGitDiff = true; - return; - } - if (!currentFile || !currentFile.isGitDiff && currentFile && line.startsWith(oldFileNameHeader) && nxtLine.startsWith(newFileNameHeader) && afterNxtLine.startsWith(hunkHeaderPrefix)) { - startFile(); - } - if (currentFile === null || currentFile === void 0 ? void 0 : currentFile.isTooBig) { - return; - } - if (currentFile && (typeof config.diffMaxChanges === "number" && currentFile.addedLines + currentFile.deletedLines > config.diffMaxChanges || typeof config.diffMaxLineLength === "number" && line.length > config.diffMaxLineLength)) { - currentFile.isTooBig = true; - currentFile.addedLines = 0; - currentFile.deletedLines = 0; - currentFile.blocks = []; - currentBlock = null; - var message = typeof config.diffTooBigMessage === "function" ? config.diffTooBigMessage(files.length) : "Diff too big to be displayed"; - startBlock(message); - return; - } - if (line.startsWith(oldFileNameHeader) && nxtLine.startsWith(newFileNameHeader) || line.startsWith(newFileNameHeader) && prevLine.startsWith(oldFileNameHeader)) { - if (currentFile && !currentFile.oldName && line.startsWith("--- ") && (values = getSrcFilename(line, config.srcPrefix))) { - currentFile.oldName = values; - currentFile.language = getExtension(currentFile.oldName, currentFile.language); - return; - } - if (currentFile && !currentFile.newName && line.startsWith("+++ ") && (values = getDstFilename(line, config.dstPrefix))) { - currentFile.newName = values; - currentFile.language = getExtension(currentFile.newName, currentFile.language); - return; - } - } - if (currentFile && (line.startsWith(hunkHeaderPrefix) || currentFile.isGitDiff && currentFile.oldName && currentFile.newName && !currentBlock)) { - startBlock(line); - return; - } - if (currentBlock && (line.startsWith("+") || line.startsWith("-") || line.startsWith(" "))) { - createLine(line); - return; - } - var doesNotExistHunkHeader = !existHunkHeader(line, lineIndex); - if (currentFile === null) { - throw new Error("Where is my file !!!"); - } - if (values = oldMode.exec(line)) { - currentFile.oldMode = values[1]; - } else if (values = newMode.exec(line)) { - currentFile.newMode = values[1]; - } else if (values = deletedFileMode.exec(line)) { - currentFile.deletedFileMode = values[1]; - currentFile.isDeleted = true; - } else if (values = newFileMode.exec(line)) { - currentFile.newFileMode = values[1]; - currentFile.isNew = true; - } else if (values = copyFrom.exec(line)) { - if (doesNotExistHunkHeader) { - currentFile.oldName = values[1]; - } - currentFile.isCopy = true; - } else if (values = copyTo.exec(line)) { - if (doesNotExistHunkHeader) { - currentFile.newName = values[1]; - } - currentFile.isCopy = true; - } else if (values = renameFrom.exec(line)) { - if (doesNotExistHunkHeader) { - currentFile.oldName = values[1]; - } - currentFile.isRename = true; - } else if (values = renameTo.exec(line)) { - if (doesNotExistHunkHeader) { - currentFile.newName = values[1]; - } - currentFile.isRename = true; - } else if (values = binaryFiles.exec(line)) { - currentFile.isBinary = true; - currentFile.oldName = getFilename(values[1], void 0, config.srcPrefix); - currentFile.newName = getFilename(values[2], void 0, config.dstPrefix); - startBlock("Binary file"); - } else if (binaryDiff.test(line)) { - currentFile.isBinary = true; - startBlock(line); - } else if (values = similarityIndex.exec(line)) { - currentFile.unchangedPercentage = parseInt(values[1], 10); - } else if (values = dissimilarityIndex.exec(line)) { - currentFile.changedPercentage = parseInt(values[1], 10); - } else if (values = index.exec(line)) { - currentFile.checksumBefore = values[1]; - currentFile.checksumAfter = values[2]; - values[3] && (currentFile.mode = values[3]); - } else if (values = combinedIndex.exec(line)) { - currentFile.checksumBefore = [values[2], values[3]]; - currentFile.checksumAfter = values[1]; - } else if (values = combinedMode.exec(line)) { - currentFile.oldMode = [values[2], values[3]]; - currentFile.newMode = values[1]; - } else if (values = combinedNewFile.exec(line)) { - currentFile.newFileMode = values[1]; - currentFile.isNew = true; - } else if (values = combinedDeletedFile.exec(line)) { - currentFile.deletedFileMode = values[1]; - currentFile.isDeleted = true; - } - }); - saveBlock(); - saveFile(); - return files; - } - exports.parse = parse; - } -}); - -// node_modules/diff/lib/diff/base.js -var require_base = __commonJS({ - "node_modules/diff/lib/diff/base.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports["default"] = Diff; - function Diff() { - } - Diff.prototype = { - diff: function diff(oldString, newString) { - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; - var callback = options.callback; - if (typeof options === "function") { - callback = options; - options = {}; - } - this.options = options; - var self2 = this; - function done(value) { - if (callback) { - setTimeout(function() { - callback(void 0, value); - }, 0); - return true; - } else { - return value; - } - } - oldString = this.castInput(oldString); - newString = this.castInput(newString); - oldString = this.removeEmpty(this.tokenize(oldString)); - newString = this.removeEmpty(this.tokenize(newString)); - var newLen = newString.length, oldLen = oldString.length; - var editLength = 1; - var maxEditLength = newLen + oldLen; - var bestPath = [{ - newPos: -1, - components: [] - }]; - var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); - if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { - return done([{ - value: this.join(newString), - count: newString.length - }]); - } - function execEditLength() { - for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { - var basePath = void 0; - var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; - if (addPath) { - bestPath[diagonalPath - 1] = void 0; - } - var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; - if (!canAdd && !canRemove) { - bestPath[diagonalPath] = void 0; - continue; - } - if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { - basePath = clonePath(removePath); - self2.pushComponent(basePath.components, void 0, true); - } else { - basePath = addPath; - basePath.newPos++; - self2.pushComponent(basePath.components, true, void 0); - } - _oldPos = self2.extractCommon(basePath, newString, oldString, diagonalPath); - if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { - return done(buildValues(self2, basePath.components, newString, oldString, self2.useLongestToken)); - } else { - bestPath[diagonalPath] = basePath; - } - } - editLength++; - } - if (callback) { - (function exec() { - setTimeout(function() { - if (editLength > maxEditLength) { - return callback(); - } - if (!execEditLength()) { - exec(); - } - }, 0); - })(); - } else { - while (editLength <= maxEditLength) { - var ret = execEditLength(); - if (ret) { - return ret; - } - } - } - }, - pushComponent: function pushComponent(components, added, removed) { - var last = components[components.length - 1]; - if (last && last.added === added && last.removed === removed) { - components[components.length - 1] = { - count: last.count + 1, - added, - removed - }; - } else { - components.push({ - count: 1, - added, - removed - }); - } - }, - extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { - var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0; - while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { - newPos++; - oldPos++; - commonCount++; - } - if (commonCount) { - basePath.components.push({ - count: commonCount - }); - } - basePath.newPos = newPos; - return oldPos; - }, - equals: function equals(left, right) { - if (this.options.comparator) { - return this.options.comparator(left, right); - } else { - return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); - } - }, - removeEmpty: function removeEmpty(array) { - var ret = []; - for (var i = 0; i < array.length; i++) { - if (array[i]) { - ret.push(array[i]); - } - } - return ret; - }, - castInput: function castInput(value) { - return value; - }, - tokenize: function tokenize(value) { - return value.split(""); - }, - join: function join2(chars) { - return chars.join(""); - } - }; - function buildValues(diff, components, newString, oldString, useLongestToken) { - var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0; - for (; componentPos < componentLen; componentPos++) { - var component = components[componentPos]; - if (!component.removed) { - if (!component.added && useLongestToken) { - var value = newString.slice(newPos, newPos + component.count); - value = value.map(function(value2, i) { - var oldValue = oldString[oldPos + i]; - return oldValue.length > value2.length ? oldValue : value2; - }); - component.value = diff.join(value); - } else { - component.value = diff.join(newString.slice(newPos, newPos + component.count)); - } - newPos += component.count; - if (!component.added) { - oldPos += component.count; - } - } else { - component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); - oldPos += component.count; - if (componentPos && components[componentPos - 1].added) { - var tmp = components[componentPos - 1]; - components[componentPos - 1] = components[componentPos]; - components[componentPos] = tmp; - } - } - } - var lastComponent = components[componentLen - 1]; - if (componentLen > 1 && typeof lastComponent.value === "string" && (lastComponent.added || lastComponent.removed) && diff.equals("", lastComponent.value)) { - components[componentLen - 2].value += lastComponent.value; - components.pop(); - } - return components; - } - function clonePath(path3) { - return { - newPos: path3.newPos, - components: path3.components.slice(0) - }; - } - } -}); - -// node_modules/diff/lib/diff/character.js -var require_character = __commonJS({ - "node_modules/diff/lib/diff/character.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.diffChars = diffChars; - exports.characterDiff = void 0; - var _base = _interopRequireDefault(require_base()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - var characterDiff = new _base["default"](); - exports.characterDiff = characterDiff; - function diffChars(oldStr, newStr, options) { - return characterDiff.diff(oldStr, newStr, options); - } - } -}); - -// node_modules/diff/lib/util/params.js -var require_params = __commonJS({ - "node_modules/diff/lib/util/params.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.generateOptions = generateOptions; - function generateOptions(options, defaults) { - if (typeof options === "function") { - defaults.callback = options; - } else if (options) { - for (var name in options) { - if (options.hasOwnProperty(name)) { - defaults[name] = options[name]; - } - } - } - return defaults; - } - } -}); - -// node_modules/diff/lib/diff/word.js -var require_word = __commonJS({ - "node_modules/diff/lib/diff/word.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.diffWords = diffWords; - exports.diffWordsWithSpace = diffWordsWithSpace; - exports.wordDiff = void 0; - var _base = _interopRequireDefault(require_base()); - var _params = require_params(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; - var reWhitespace = /\S/; - var wordDiff = new _base["default"](); - exports.wordDiff = wordDiff; - wordDiff.equals = function(left, right) { - if (this.options.ignoreCase) { - left = left.toLowerCase(); - right = right.toLowerCase(); - } - return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right); - }; - wordDiff.tokenize = function(value) { - var tokens = value.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/); - for (var i = 0; i < tokens.length - 1; i++) { - if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) { - tokens[i] += tokens[i + 2]; - tokens.splice(i + 1, 2); - i--; - } - } - return tokens; - }; - function diffWords(oldStr, newStr, options) { - options = (0, _params.generateOptions)(options, { - ignoreWhitespace: true - }); - return wordDiff.diff(oldStr, newStr, options); - } - function diffWordsWithSpace(oldStr, newStr, options) { - return wordDiff.diff(oldStr, newStr, options); - } - } -}); - -// node_modules/diff/lib/diff/line.js -var require_line = __commonJS({ - "node_modules/diff/lib/diff/line.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.diffLines = diffLines; - exports.diffTrimmedLines = diffTrimmedLines; - exports.lineDiff = void 0; - var _base = _interopRequireDefault(require_base()); - var _params = require_params(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - var lineDiff = new _base["default"](); - exports.lineDiff = lineDiff; - lineDiff.tokenize = function(value) { - var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/); - if (!linesAndNewlines[linesAndNewlines.length - 1]) { - linesAndNewlines.pop(); - } - for (var i = 0; i < linesAndNewlines.length; i++) { - var line = linesAndNewlines[i]; - if (i % 2 && !this.options.newlineIsToken) { - retLines[retLines.length - 1] += line; - } else { - if (this.options.ignoreWhitespace) { - line = line.trim(); - } - retLines.push(line); - } - } - return retLines; - }; - function diffLines(oldStr, newStr, callback) { - return lineDiff.diff(oldStr, newStr, callback); - } - function diffTrimmedLines(oldStr, newStr, callback) { - var options = (0, _params.generateOptions)(callback, { - ignoreWhitespace: true - }); - return lineDiff.diff(oldStr, newStr, options); - } - } -}); - -// node_modules/diff/lib/diff/sentence.js -var require_sentence = __commonJS({ - "node_modules/diff/lib/diff/sentence.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.diffSentences = diffSentences; - exports.sentenceDiff = void 0; - var _base = _interopRequireDefault(require_base()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - var sentenceDiff = new _base["default"](); - exports.sentenceDiff = sentenceDiff; - sentenceDiff.tokenize = function(value) { - return value.split(/(\S.+?[.!?])(?=\s+|$)/); - }; - function diffSentences(oldStr, newStr, callback) { - return sentenceDiff.diff(oldStr, newStr, callback); - } - } -}); - -// node_modules/diff/lib/diff/css.js -var require_css = __commonJS({ - "node_modules/diff/lib/diff/css.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.diffCss = diffCss; - exports.cssDiff = void 0; - var _base = _interopRequireDefault(require_base()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - var cssDiff = new _base["default"](); - exports.cssDiff = cssDiff; - cssDiff.tokenize = function(value) { - return value.split(/([{}:;,]|\s+)/); - }; - function diffCss(oldStr, newStr, callback) { - return cssDiff.diff(oldStr, newStr, callback); - } - } -}); - -// node_modules/diff/lib/diff/json.js -var require_json = __commonJS({ - "node_modules/diff/lib/diff/json.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.diffJson = diffJson; - exports.canonicalize = canonicalize; - exports.jsonDiff = void 0; - var _base = _interopRequireDefault(require_base()); - var _line = require_line(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function _typeof(obj) { - "@babel/helpers - typeof"; - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function _typeof2(obj2) { - return typeof obj2; - }; - } else { - _typeof = function _typeof2(obj2) { - return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }; - } - return _typeof(obj); - } - var objectPrototypeToString = Object.prototype.toString; - var jsonDiff = new _base["default"](); - exports.jsonDiff = jsonDiff; - jsonDiff.useLongestToken = true; - jsonDiff.tokenize = _line.lineDiff.tokenize; - jsonDiff.castInput = function(value) { - var _this$options = this.options, undefinedReplacement = _this$options.undefinedReplacement, _this$options$stringi = _this$options.stringifyReplacer, stringifyReplacer = _this$options$stringi === void 0 ? function(k, v) { - return typeof v === "undefined" ? undefinedReplacement : v; - } : _this$options$stringi; - return typeof value === "string" ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, " "); - }; - jsonDiff.equals = function(left, right) { - return _base["default"].prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, "$1"), right.replace(/,([\r\n])/g, "$1")); - }; - function diffJson(oldObj, newObj, options) { - return jsonDiff.diff(oldObj, newObj, options); - } - function canonicalize(obj, stack, replacementStack, replacer, key2) { - stack = stack || []; - replacementStack = replacementStack || []; - if (replacer) { - obj = replacer(key2, obj); - } - var i; - for (i = 0; i < stack.length; i += 1) { - if (stack[i] === obj) { - return replacementStack[i]; - } - } - var canonicalizedObj; - if (objectPrototypeToString.call(obj) === "[object Array]") { - stack.push(obj); - canonicalizedObj = new Array(obj.length); - replacementStack.push(canonicalizedObj); - for (i = 0; i < obj.length; i += 1) { - canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key2); - } - stack.pop(); - replacementStack.pop(); - return canonicalizedObj; - } - if (obj && obj.toJSON) { - obj = obj.toJSON(); - } - if (_typeof(obj) === "object" && obj !== null) { - stack.push(obj); - canonicalizedObj = {}; - replacementStack.push(canonicalizedObj); - var sortedKeys = [], _key; - for (_key in obj) { - if (obj.hasOwnProperty(_key)) { - sortedKeys.push(_key); - } - } - sortedKeys.sort(); - for (i = 0; i < sortedKeys.length; i += 1) { - _key = sortedKeys[i]; - canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key); - } - stack.pop(); - replacementStack.pop(); - } else { - canonicalizedObj = obj; - } - return canonicalizedObj; - } - } -}); - -// node_modules/diff/lib/diff/array.js -var require_array = __commonJS({ - "node_modules/diff/lib/diff/array.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.diffArrays = diffArrays; - exports.arrayDiff = void 0; - var _base = _interopRequireDefault(require_base()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - var arrayDiff = new _base["default"](); - exports.arrayDiff = arrayDiff; - arrayDiff.tokenize = function(value) { - return value.slice(); - }; - arrayDiff.join = arrayDiff.removeEmpty = function(value) { - return value; - }; - function diffArrays(oldArr, newArr, callback) { - return arrayDiff.diff(oldArr, newArr, callback); - } - } -}); - -// node_modules/diff/lib/patch/parse.js -var require_parse = __commonJS({ - "node_modules/diff/lib/patch/parse.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.parsePatch = parsePatch; - function parsePatch(uniDiff) { - var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/), delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [], list = [], i = 0; - function parseIndex() { - var index = {}; - list.push(index); - while (i < diffstr.length) { - var line = diffstr[i]; - if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) { - break; - } - var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line); - if (header) { - index.index = header[1]; - } - i++; - } - parseFileHeader(index); - parseFileHeader(index); - index.hunks = []; - while (i < diffstr.length) { - var _line = diffstr[i]; - if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) { - break; - } else if (/^@@/.test(_line)) { - index.hunks.push(parseHunk()); - } else if (_line && options.strict) { - throw new Error("Unknown line " + (i + 1) + " " + JSON.stringify(_line)); - } else { - i++; - } - } - } - function parseFileHeader(index) { - var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i]); - if (fileHeader) { - var keyPrefix = fileHeader[1] === "---" ? "old" : "new"; - var data = fileHeader[2].split(" ", 2); - var fileName = data[0].replace(/\\\\/g, "\\"); - if (/^".*"$/.test(fileName)) { - fileName = fileName.substr(1, fileName.length - 2); - } - index[keyPrefix + "FileName"] = fileName; - index[keyPrefix + "Header"] = (data[1] || "").trim(); - i++; - } - } - function parseHunk() { - var chunkHeaderIndex = i, chunkHeaderLine = diffstr[i++], chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/); - var hunk = { - oldStart: +chunkHeader[1], - oldLines: typeof chunkHeader[2] === "undefined" ? 1 : +chunkHeader[2], - newStart: +chunkHeader[3], - newLines: typeof chunkHeader[4] === "undefined" ? 1 : +chunkHeader[4], - lines: [], - linedelimiters: [] - }; - if (hunk.oldLines === 0) { - hunk.oldStart += 1; - } - if (hunk.newLines === 0) { - hunk.newStart += 1; - } - var addCount = 0, removeCount = 0; - for (; i < diffstr.length; i++) { - if (diffstr[i].indexOf("--- ") === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf("+++ ") === 0 && diffstr[i + 2].indexOf("@@") === 0) { - break; - } - var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? " " : diffstr[i][0]; - if (operation === "+" || operation === "-" || operation === " " || operation === "\\") { - hunk.lines.push(diffstr[i]); - hunk.linedelimiters.push(delimiters[i] || "\n"); - if (operation === "+") { - addCount++; - } else if (operation === "-") { - removeCount++; - } else if (operation === " ") { - addCount++; - removeCount++; - } - } else { - break; - } - } - if (!addCount && hunk.newLines === 1) { - hunk.newLines = 0; - } - if (!removeCount && hunk.oldLines === 1) { - hunk.oldLines = 0; - } - if (options.strict) { - if (addCount !== hunk.newLines) { - throw new Error("Added line count did not match for hunk at line " + (chunkHeaderIndex + 1)); - } - if (removeCount !== hunk.oldLines) { - throw new Error("Removed line count did not match for hunk at line " + (chunkHeaderIndex + 1)); - } - } - return hunk; - } - while (i < diffstr.length) { - parseIndex(); - } - return list; - } - } -}); - -// node_modules/diff/lib/util/distance-iterator.js -var require_distance_iterator = __commonJS({ - "node_modules/diff/lib/util/distance-iterator.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports["default"] = _default; - function _default(start, minLine, maxLine) { - var wantForward = true, backwardExhausted = false, forwardExhausted = false, localOffset = 1; - return function iterator() { - if (wantForward && !forwardExhausted) { - if (backwardExhausted) { - localOffset++; - } else { - wantForward = false; - } - if (start + localOffset <= maxLine) { - return localOffset; - } - forwardExhausted = true; - } - if (!backwardExhausted) { - if (!forwardExhausted) { - wantForward = true; - } - if (minLine <= start - localOffset) { - return -localOffset++; - } - backwardExhausted = true; - return iterator(); - } - }; - } - } -}); - -// node_modules/diff/lib/patch/apply.js -var require_apply = __commonJS({ - "node_modules/diff/lib/patch/apply.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.applyPatch = applyPatch; - exports.applyPatches = applyPatches; - var _parse = require_parse(); - var _distanceIterator = _interopRequireDefault(require_distance_iterator()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function applyPatch(source, uniDiff) { - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; - if (typeof uniDiff === "string") { - uniDiff = (0, _parse.parsePatch)(uniDiff); - } - if (Array.isArray(uniDiff)) { - if (uniDiff.length > 1) { - throw new Error("applyPatch only works with a single input."); - } - uniDiff = uniDiff[0]; - } - var lines = source.split(/\r\n|[\n\v\f\r\x85]/), delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [], hunks = uniDiff.hunks, compareLine = options.compareLine || function(lineNumber, line2, operation2, patchContent) { - return line2 === patchContent; - }, errorCount = 0, fuzzFactor = options.fuzzFactor || 0, minLine = 0, offset = 0, removeEOFNL, addEOFNL; - function hunkFits(hunk2, toPos2) { - for (var j2 = 0; j2 < hunk2.lines.length; j2++) { - var line2 = hunk2.lines[j2], operation2 = line2.length > 0 ? line2[0] : " ", content2 = line2.length > 0 ? line2.substr(1) : line2; - if (operation2 === " " || operation2 === "-") { - if (!compareLine(toPos2 + 1, lines[toPos2], operation2, content2)) { - errorCount++; - if (errorCount > fuzzFactor) { - return false; - } - } - toPos2++; - } - } - return true; - } - for (var i = 0; i < hunks.length; i++) { - var hunk = hunks[i], maxLine = lines.length - hunk.oldLines, localOffset = 0, toPos = offset + hunk.oldStart - 1; - var iterator = (0, _distanceIterator["default"])(toPos, minLine, maxLine); - for (; localOffset !== void 0; localOffset = iterator()) { - if (hunkFits(hunk, toPos + localOffset)) { - hunk.offset = offset += localOffset; - break; - } - } - if (localOffset === void 0) { - return false; - } - minLine = hunk.offset + hunk.oldStart + hunk.oldLines; - } - var diffOffset = 0; - for (var _i = 0; _i < hunks.length; _i++) { - var _hunk = hunks[_i], _toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1; - diffOffset += _hunk.newLines - _hunk.oldLines; - for (var j = 0; j < _hunk.lines.length; j++) { - var line = _hunk.lines[j], operation = line.length > 0 ? line[0] : " ", content = line.length > 0 ? line.substr(1) : line, delimiter = _hunk.linedelimiters[j]; - if (operation === " ") { - _toPos++; - } else if (operation === "-") { - lines.splice(_toPos, 1); - delimiters.splice(_toPos, 1); - } else if (operation === "+") { - lines.splice(_toPos, 0, content); - delimiters.splice(_toPos, 0, delimiter); - _toPos++; - } else if (operation === "\\") { - var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null; - if (previousOperation === "+") { - removeEOFNL = true; - } else if (previousOperation === "-") { - addEOFNL = true; - } - } - } - } - if (removeEOFNL) { - while (!lines[lines.length - 1]) { - lines.pop(); - delimiters.pop(); - } - } else if (addEOFNL) { - lines.push(""); - delimiters.push("\n"); - } - for (var _k = 0; _k < lines.length - 1; _k++) { - lines[_k] = lines[_k] + delimiters[_k]; - } - return lines.join(""); - } - function applyPatches(uniDiff, options) { - if (typeof uniDiff === "string") { - uniDiff = (0, _parse.parsePatch)(uniDiff); - } - var currentIndex = 0; - function processIndex() { - var index = uniDiff[currentIndex++]; - if (!index) { - return options.complete(); - } - options.loadFile(index, function(err, data) { - if (err) { - return options.complete(err); - } - var updatedContent = applyPatch(data, index, options); - options.patched(index, updatedContent, function(err2) { - if (err2) { - return options.complete(err2); - } - processIndex(); - }); - }); - } - processIndex(); - } - } -}); - -// node_modules/diff/lib/patch/create.js -var require_create = __commonJS({ - "node_modules/diff/lib/patch/create.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.structuredPatch = structuredPatch; - exports.formatPatch = formatPatch; - exports.createTwoFilesPatch = createTwoFilesPatch; - exports.createPatch = createPatch; - var _line = require_line(); - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); - } - function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - function _unsupportedIterableToArray(o, minLen) { - if (!o) - return; - if (typeof o === "string") - return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) - n = o.constructor.name; - if (n === "Map" || n === "Set") - return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) - return _arrayLikeToArray(o, minLen); - } - function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) - return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) - return _arrayLikeToArray(arr); - } - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) - len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { - if (!options) { - options = {}; - } - if (typeof options.context === "undefined") { - options.context = 4; - } - var diff = (0, _line.diffLines)(oldStr, newStr, options); - diff.push({ - value: "", - lines: [] - }); - function contextLines(lines) { - return lines.map(function(entry) { - return " " + entry; - }); - } - var hunks = []; - var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1; - var _loop = function _loop2(i2) { - var current = diff[i2], lines = current.lines || current.value.replace(/\n$/, "").split("\n"); - current.lines = lines; - if (current.added || current.removed) { - var _curRange; - if (!oldRangeStart) { - var prev = diff[i2 - 1]; - oldRangeStart = oldLine; - newRangeStart = newLine; - if (prev) { - curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : []; - oldRangeStart -= curRange.length; - newRangeStart -= curRange.length; - } - } - (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function(entry) { - return (current.added ? "+" : "-") + entry; - }))); - if (current.added) { - newLine += lines.length; - } else { - oldLine += lines.length; - } - } else { - if (oldRangeStart) { - if (lines.length <= options.context * 2 && i2 < diff.length - 2) { - var _curRange2; - (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines))); - } else { - var _curRange3; - var contextSize = Math.min(lines.length, options.context); - (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize)))); - var hunk = { - oldStart: oldRangeStart, - oldLines: oldLine - oldRangeStart + contextSize, - newStart: newRangeStart, - newLines: newLine - newRangeStart + contextSize, - lines: curRange - }; - if (i2 >= diff.length - 2 && lines.length <= options.context) { - var oldEOFNewline = /\n$/.test(oldStr); - var newEOFNewline = /\n$/.test(newStr); - var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines; - if (!oldEOFNewline && noNlBeforeAdds && oldStr.length > 0) { - curRange.splice(hunk.oldLines, 0, "\\ No newline at end of file"); - } - if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) { - curRange.push("\\ No newline at end of file"); - } - } - hunks.push(hunk); - oldRangeStart = 0; - newRangeStart = 0; - curRange = []; - } - } - oldLine += lines.length; - newLine += lines.length; - } - }; - for (var i = 0; i < diff.length; i++) { - _loop(i); - } - return { - oldFileName, - newFileName, - oldHeader, - newHeader, - hunks - }; - } - function formatPatch(diff) { - var ret = []; - if (diff.oldFileName == diff.newFileName) { - ret.push("Index: " + diff.oldFileName); - } - ret.push("==================================================================="); - ret.push("--- " + diff.oldFileName + (typeof diff.oldHeader === "undefined" ? "" : " " + diff.oldHeader)); - ret.push("+++ " + diff.newFileName + (typeof diff.newHeader === "undefined" ? "" : " " + diff.newHeader)); - for (var i = 0; i < diff.hunks.length; i++) { - var hunk = diff.hunks[i]; - if (hunk.oldLines === 0) { - hunk.oldStart -= 1; - } - if (hunk.newLines === 0) { - hunk.newStart -= 1; - } - ret.push("@@ -" + hunk.oldStart + "," + hunk.oldLines + " +" + hunk.newStart + "," + hunk.newLines + " @@"); - ret.push.apply(ret, hunk.lines); - } - return ret.join("\n") + "\n"; - } - function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { - return formatPatch(structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options)); - } - function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { - return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); - } - } -}); - -// node_modules/diff/lib/util/array.js -var require_array2 = __commonJS({ - "node_modules/diff/lib/util/array.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.arrayEqual = arrayEqual; - exports.arrayStartsWith = arrayStartsWith; - function arrayEqual(a, b) { - if (a.length !== b.length) { - return false; - } - return arrayStartsWith(a, b); - } - function arrayStartsWith(array, start) { - if (start.length > array.length) { - return false; - } - for (var i = 0; i < start.length; i++) { - if (start[i] !== array[i]) { - return false; - } - } - return true; - } - } -}); - -// node_modules/diff/lib/patch/merge.js -var require_merge2 = __commonJS({ - "node_modules/diff/lib/patch/merge.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.calcLineCount = calcLineCount; - exports.merge = merge; - var _create = require_create(); - var _parse = require_parse(); - var _array = require_array2(); - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); - } - function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - function _unsupportedIterableToArray(o, minLen) { - if (!o) - return; - if (typeof o === "string") - return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) - n = o.constructor.name; - if (n === "Map" || n === "Set") - return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) - return _arrayLikeToArray(o, minLen); - } - function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) - return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) - return _arrayLikeToArray(arr); - } - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) - len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - function calcLineCount(hunk) { - var _calcOldNewLineCount = calcOldNewLineCount(hunk.lines), oldLines = _calcOldNewLineCount.oldLines, newLines = _calcOldNewLineCount.newLines; - if (oldLines !== void 0) { - hunk.oldLines = oldLines; - } else { - delete hunk.oldLines; - } - if (newLines !== void 0) { - hunk.newLines = newLines; - } else { - delete hunk.newLines; - } - } - function merge(mine, theirs, base) { - mine = loadPatch(mine, base); - theirs = loadPatch(theirs, base); - var ret = {}; - if (mine.index || theirs.index) { - ret.index = mine.index || theirs.index; - } - if (mine.newFileName || theirs.newFileName) { - if (!fileNameChanged(mine)) { - ret.oldFileName = theirs.oldFileName || mine.oldFileName; - ret.newFileName = theirs.newFileName || mine.newFileName; - ret.oldHeader = theirs.oldHeader || mine.oldHeader; - ret.newHeader = theirs.newHeader || mine.newHeader; - } else if (!fileNameChanged(theirs)) { - ret.oldFileName = mine.oldFileName; - ret.newFileName = mine.newFileName; - ret.oldHeader = mine.oldHeader; - ret.newHeader = mine.newHeader; - } else { - ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName); - ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName); - ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader); - ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader); - } - } - ret.hunks = []; - var mineIndex = 0, theirsIndex = 0, mineOffset = 0, theirsOffset = 0; - while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) { - var mineCurrent = mine.hunks[mineIndex] || { - oldStart: Infinity - }, theirsCurrent = theirs.hunks[theirsIndex] || { - oldStart: Infinity - }; - if (hunkBefore(mineCurrent, theirsCurrent)) { - ret.hunks.push(cloneHunk(mineCurrent, mineOffset)); - mineIndex++; - theirsOffset += mineCurrent.newLines - mineCurrent.oldLines; - } else if (hunkBefore(theirsCurrent, mineCurrent)) { - ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset)); - theirsIndex++; - mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines; - } else { - var mergedHunk = { - oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart), - oldLines: 0, - newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset), - newLines: 0, - lines: [] - }; - mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines); - theirsIndex++; - mineIndex++; - ret.hunks.push(mergedHunk); - } - } - return ret; - } - function loadPatch(param, base) { - if (typeof param === "string") { - if (/^@@/m.test(param) || /^Index:/m.test(param)) { - return (0, _parse.parsePatch)(param)[0]; - } - if (!base) { - throw new Error("Must provide a base reference or pass in a patch"); - } - return (0, _create.structuredPatch)(void 0, void 0, base, param); - } - return param; - } - function fileNameChanged(patch) { - return patch.newFileName && patch.newFileName !== patch.oldFileName; - } - function selectField(index, mine, theirs) { - if (mine === theirs) { - return mine; - } else { - index.conflict = true; - return { - mine, - theirs - }; - } - } - function hunkBefore(test, check) { - return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart; - } - function cloneHunk(hunk, offset) { - return { - oldStart: hunk.oldStart, - oldLines: hunk.oldLines, - newStart: hunk.newStart + offset, - newLines: hunk.newLines, - lines: hunk.lines - }; - } - function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) { - var mine = { - offset: mineOffset, - lines: mineLines, - index: 0 - }, their = { - offset: theirOffset, - lines: theirLines, - index: 0 - }; - insertLeading(hunk, mine, their); - insertLeading(hunk, their, mine); - while (mine.index < mine.lines.length && their.index < their.lines.length) { - var mineCurrent = mine.lines[mine.index], theirCurrent = their.lines[their.index]; - if ((mineCurrent[0] === "-" || mineCurrent[0] === "+") && (theirCurrent[0] === "-" || theirCurrent[0] === "+")) { - mutualChange(hunk, mine, their); - } else if (mineCurrent[0] === "+" && theirCurrent[0] === " ") { - var _hunk$lines; - (_hunk$lines = hunk.lines).push.apply(_hunk$lines, _toConsumableArray(collectChange(mine))); - } else if (theirCurrent[0] === "+" && mineCurrent[0] === " ") { - var _hunk$lines2; - (_hunk$lines2 = hunk.lines).push.apply(_hunk$lines2, _toConsumableArray(collectChange(their))); - } else if (mineCurrent[0] === "-" && theirCurrent[0] === " ") { - removal(hunk, mine, their); - } else if (theirCurrent[0] === "-" && mineCurrent[0] === " ") { - removal(hunk, their, mine, true); - } else if (mineCurrent === theirCurrent) { - hunk.lines.push(mineCurrent); - mine.index++; - their.index++; - } else { - conflict(hunk, collectChange(mine), collectChange(their)); - } - } - insertTrailing(hunk, mine); - insertTrailing(hunk, their); - calcLineCount(hunk); - } - function mutualChange(hunk, mine, their) { - var myChanges = collectChange(mine), theirChanges = collectChange(their); - if (allRemoves(myChanges) && allRemoves(theirChanges)) { - if ((0, _array.arrayStartsWith)(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) { - var _hunk$lines3; - (_hunk$lines3 = hunk.lines).push.apply(_hunk$lines3, _toConsumableArray(myChanges)); - return; - } else if ((0, _array.arrayStartsWith)(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) { - var _hunk$lines4; - (_hunk$lines4 = hunk.lines).push.apply(_hunk$lines4, _toConsumableArray(theirChanges)); - return; - } - } else if ((0, _array.arrayEqual)(myChanges, theirChanges)) { - var _hunk$lines5; - (_hunk$lines5 = hunk.lines).push.apply(_hunk$lines5, _toConsumableArray(myChanges)); - return; - } - conflict(hunk, myChanges, theirChanges); - } - function removal(hunk, mine, their, swap) { - var myChanges = collectChange(mine), theirChanges = collectContext(their, myChanges); - if (theirChanges.merged) { - var _hunk$lines6; - (_hunk$lines6 = hunk.lines).push.apply(_hunk$lines6, _toConsumableArray(theirChanges.merged)); - } else { - conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges); - } - } - function conflict(hunk, mine, their) { - hunk.conflict = true; - hunk.lines.push({ - conflict: true, - mine, - theirs: their - }); - } - function insertLeading(hunk, insert2, their) { - while (insert2.offset < their.offset && insert2.index < insert2.lines.length) { - var line = insert2.lines[insert2.index++]; - hunk.lines.push(line); - insert2.offset++; - } - } - function insertTrailing(hunk, insert2) { - while (insert2.index < insert2.lines.length) { - var line = insert2.lines[insert2.index++]; - hunk.lines.push(line); - } - } - function collectChange(state) { - var ret = [], operation = state.lines[state.index][0]; - while (state.index < state.lines.length) { - var line = state.lines[state.index]; - if (operation === "-" && line[0] === "+") { - operation = "+"; - } - if (operation === line[0]) { - ret.push(line); - state.index++; - } else { - break; - } - } - return ret; - } - function collectContext(state, matchChanges) { - var changes = [], merged = [], matchIndex = 0, contextChanges = false, conflicted = false; - while (matchIndex < matchChanges.length && state.index < state.lines.length) { - var change = state.lines[state.index], match = matchChanges[matchIndex]; - if (match[0] === "+") { - break; - } - contextChanges = contextChanges || change[0] !== " "; - merged.push(match); - matchIndex++; - if (change[0] === "+") { - conflicted = true; - while (change[0] === "+") { - changes.push(change); - change = state.lines[++state.index]; - } - } - if (match.substr(1) === change.substr(1)) { - changes.push(change); - state.index++; - } else { - conflicted = true; - } - } - if ((matchChanges[matchIndex] || "")[0] === "+" && contextChanges) { - conflicted = true; - } - if (conflicted) { - return changes; - } - while (matchIndex < matchChanges.length) { - merged.push(matchChanges[matchIndex++]); - } - return { - merged, - changes - }; - } - function allRemoves(changes) { - return changes.reduce(function(prev, change) { - return prev && change[0] === "-"; - }, true); - } - function skipRemoveSuperset(state, removeChanges, delta) { - for (var i = 0; i < delta; i++) { - var changeContent = removeChanges[removeChanges.length - delta + i].substr(1); - if (state.lines[state.index + i] !== " " + changeContent) { - return false; - } - } - state.index += delta; - return true; - } - function calcOldNewLineCount(lines) { - var oldLines = 0; - var newLines = 0; - lines.forEach(function(line) { - if (typeof line !== "string") { - var myCount = calcOldNewLineCount(line.mine); - var theirCount = calcOldNewLineCount(line.theirs); - if (oldLines !== void 0) { - if (myCount.oldLines === theirCount.oldLines) { - oldLines += myCount.oldLines; - } else { - oldLines = void 0; - } - } - if (newLines !== void 0) { - if (myCount.newLines === theirCount.newLines) { - newLines += myCount.newLines; - } else { - newLines = void 0; - } - } - } else { - if (newLines !== void 0 && (line[0] === "+" || line[0] === " ")) { - newLines++; - } - if (oldLines !== void 0 && (line[0] === "-" || line[0] === " ")) { - oldLines++; - } - } - }); - return { - oldLines, - newLines - }; - } - } -}); - -// node_modules/diff/lib/convert/dmp.js -var require_dmp = __commonJS({ - "node_modules/diff/lib/convert/dmp.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.convertChangesToDMP = convertChangesToDMP; - function convertChangesToDMP(changes) { - var ret = [], change, operation; - for (var i = 0; i < changes.length; i++) { - change = changes[i]; - if (change.added) { - operation = 1; - } else if (change.removed) { - operation = -1; - } else { - operation = 0; - } - ret.push([operation, change.value]); - } - return ret; - } - } -}); - -// node_modules/diff/lib/convert/xml.js -var require_xml = __commonJS({ - "node_modules/diff/lib/convert/xml.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.convertChangesToXML = convertChangesToXML; - function convertChangesToXML(changes) { - var ret = []; - for (var i = 0; i < changes.length; i++) { - var change = changes[i]; - if (change.added) { - ret.push(""); - } else if (change.removed) { - ret.push(""); - } - ret.push(escapeHTML(change.value)); - if (change.added) { - ret.push(""); - } else if (change.removed) { - ret.push(""); - } - } - return ret.join(""); - } - function escapeHTML(s) { - var n = s; - n = n.replace(/&/g, "&"); - n = n.replace(//g, ">"); - n = n.replace(/"/g, """); - return n; - } - } -}); - -// node_modules/diff/lib/index.js -var require_lib = __commonJS({ - "node_modules/diff/lib/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - Object.defineProperty(exports, "Diff", { - enumerable: true, - get: function get() { - return _base["default"]; - } - }); - Object.defineProperty(exports, "diffChars", { - enumerable: true, - get: function get() { - return _character.diffChars; - } - }); - Object.defineProperty(exports, "diffWords", { - enumerable: true, - get: function get() { - return _word.diffWords; - } - }); - Object.defineProperty(exports, "diffWordsWithSpace", { - enumerable: true, - get: function get() { - return _word.diffWordsWithSpace; - } - }); - Object.defineProperty(exports, "diffLines", { - enumerable: true, - get: function get() { - return _line.diffLines; - } - }); - Object.defineProperty(exports, "diffTrimmedLines", { - enumerable: true, - get: function get() { - return _line.diffTrimmedLines; - } - }); - Object.defineProperty(exports, "diffSentences", { - enumerable: true, - get: function get() { - return _sentence.diffSentences; - } - }); - Object.defineProperty(exports, "diffCss", { - enumerable: true, - get: function get() { - return _css.diffCss; - } - }); - Object.defineProperty(exports, "diffJson", { - enumerable: true, - get: function get() { - return _json.diffJson; - } - }); - Object.defineProperty(exports, "canonicalize", { - enumerable: true, - get: function get() { - return _json.canonicalize; - } - }); - Object.defineProperty(exports, "diffArrays", { - enumerable: true, - get: function get() { - return _array.diffArrays; - } - }); - Object.defineProperty(exports, "applyPatch", { - enumerable: true, - get: function get() { - return _apply.applyPatch; - } - }); - Object.defineProperty(exports, "applyPatches", { - enumerable: true, - get: function get() { - return _apply.applyPatches; - } - }); - Object.defineProperty(exports, "parsePatch", { - enumerable: true, - get: function get() { - return _parse.parsePatch; - } - }); - Object.defineProperty(exports, "merge", { - enumerable: true, - get: function get() { - return _merge.merge; - } - }); - Object.defineProperty(exports, "structuredPatch", { - enumerable: true, - get: function get() { - return _create.structuredPatch; - } - }); - Object.defineProperty(exports, "createTwoFilesPatch", { - enumerable: true, - get: function get() { - return _create.createTwoFilesPatch; - } - }); - Object.defineProperty(exports, "createPatch", { - enumerable: true, - get: function get() { - return _create.createPatch; - } - }); - Object.defineProperty(exports, "convertChangesToDMP", { - enumerable: true, - get: function get() { - return _dmp.convertChangesToDMP; - } - }); - Object.defineProperty(exports, "convertChangesToXML", { - enumerable: true, - get: function get() { - return _xml.convertChangesToXML; - } - }); - var _base = _interopRequireDefault(require_base()); - var _character = require_character(); - var _word = require_word(); - var _line = require_line(); - var _sentence = require_sentence(); - var _css = require_css(); - var _json = require_json(); - var _array = require_array(); - var _apply = require_apply(); - var _parse = require_parse(); - var _merge = require_merge2(); - var _create = require_create(); - var _dmp = require_dmp(); - var _xml = require_xml(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - } -}); - -// node_modules/diff2html/lib/rematch.js -var require_rematch = __commonJS({ - "node_modules/diff2html/lib/rematch.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.newMatcherFn = exports.newDistanceFn = exports.levenshtein = void 0; - function levenshtein(a, b) { - if (a.length === 0) { - return b.length; - } - if (b.length === 0) { - return a.length; - } - var matrix = []; - var i; - for (i = 0; i <= b.length; i++) { - matrix[i] = [i]; - } - var j; - for (j = 0; j <= a.length; j++) { - matrix[0][j] = j; - } - for (i = 1; i <= b.length; i++) { - for (j = 1; j <= a.length; j++) { - if (b.charAt(i - 1) === a.charAt(j - 1)) { - matrix[i][j] = matrix[i - 1][j - 1]; - } else { - matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, Math.min(matrix[i][j - 1] + 1, matrix[i - 1][j] + 1)); - } - } - } - return matrix[b.length][a.length]; - } - exports.levenshtein = levenshtein; - function newDistanceFn(str) { - return function(x, y) { - var xValue = str(x).trim(); - var yValue = str(y).trim(); - var lev = levenshtein(xValue, yValue); - return lev / (xValue.length + yValue.length); - }; - } - exports.newDistanceFn = newDistanceFn; - function newMatcherFn(distance) { - function findBestMatch(a, b, cache) { - if (cache === void 0) { - cache = new Map(); - } - var bestMatchDist = Infinity; - var bestMatch; - for (var i = 0; i < a.length; ++i) { - for (var j = 0; j < b.length; ++j) { - var cacheKey = JSON.stringify([a[i], b[j]]); - var md = void 0; - if (!(cache.has(cacheKey) && (md = cache.get(cacheKey)))) { - md = distance(a[i], b[j]); - cache.set(cacheKey, md); - } - if (md < bestMatchDist) { - bestMatchDist = md; - bestMatch = { indexA: i, indexB: j, score: bestMatchDist }; - } - } - } - return bestMatch; - } - function group(a, b, level, cache) { - if (level === void 0) { - level = 0; - } - if (cache === void 0) { - cache = new Map(); - } - var bm = findBestMatch(a, b, cache); - if (!bm || a.length + b.length < 3) { - return [[a, b]]; - } - var a1 = a.slice(0, bm.indexA); - var b1 = b.slice(0, bm.indexB); - var aMatch = [a[bm.indexA]]; - var bMatch = [b[bm.indexB]]; - var tailA = bm.indexA + 1; - var tailB = bm.indexB + 1; - var a2 = a.slice(tailA); - var b2 = b.slice(tailB); - var group1 = group(a1, b1, level + 1, cache); - var groupMatch = group(aMatch, bMatch, level + 1, cache); - var group2 = group(a2, b2, level + 1, cache); - var result = groupMatch; - if (bm.indexA > 0 || bm.indexB > 0) { - result = group1.concat(result); - } - if (a.length > tailA || b.length > tailB) { - result = result.concat(group2); - } - return result; - } - return group; - } - exports.newMatcherFn = newMatcherFn; - } -}); - -// node_modules/diff2html/lib/render-utils.js -var require_render_utils = __commonJS({ - "node_modules/diff2html/lib/render-utils.js"(exports) { - "use strict"; - var __assign2 = exports && exports.__assign || function() { - __assign2 = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign2.apply(this, arguments); - }; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding2(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.diffHighlight = exports.getFileIcon = exports.getHtmlId = exports.filenameDiff = exports.deconstructLine = exports.escapeForHtml = exports.toCSSClass = exports.defaultRenderConfig = exports.CSSLineClass = void 0; - var jsDiff = __importStar2(require_lib()); - var utils_1 = require_utils2(); - var rematch = __importStar2(require_rematch()); - var types_1 = require_types(); - exports.CSSLineClass = { - INSERTS: "d2h-ins", - DELETES: "d2h-del", - CONTEXT: "d2h-cntx", - INFO: "d2h-info", - INSERT_CHANGES: "d2h-ins d2h-change", - DELETE_CHANGES: "d2h-del d2h-change" - }; - exports.defaultRenderConfig = { - matching: types_1.LineMatchingType.NONE, - matchWordsThreshold: 0.25, - maxLineLengthHighlight: 1e4, - diffStyle: types_1.DiffStyleType.WORD - }; - var separator = "/"; - var distance = rematch.newDistanceFn(function(change) { - return change.value; - }); - var matcher = rematch.newMatcherFn(distance); - function isDevNullName(name) { - return name.indexOf("dev/null") !== -1; - } - function removeInsElements(line) { - return line.replace(/(]*>((.|\n)*?)<\/ins>)/g, ""); - } - function removeDelElements(line) { - return line.replace(/(]*>((.|\n)*?)<\/del>)/g, ""); - } - function toCSSClass(lineType) { - switch (lineType) { - case types_1.LineType.CONTEXT: - return exports.CSSLineClass.CONTEXT; - case types_1.LineType.INSERT: - return exports.CSSLineClass.INSERTS; - case types_1.LineType.DELETE: - return exports.CSSLineClass.DELETES; - } - } - exports.toCSSClass = toCSSClass; - function prefixLength(isCombined) { - return isCombined ? 2 : 1; - } - function escapeForHtml(str) { - return str.slice(0).replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/\//g, "/"); - } - exports.escapeForHtml = escapeForHtml; - function deconstructLine(line, isCombined, escape) { - if (escape === void 0) { - escape = true; - } - var indexToSplit = prefixLength(isCombined); - return { - prefix: line.substring(0, indexToSplit), - content: escape ? escapeForHtml(line.substring(indexToSplit)) : line.substring(indexToSplit) - }; - } - exports.deconstructLine = deconstructLine; - function filenameDiff(file) { - var oldFilename = (0, utils_1.unifyPath)(file.oldName); - var newFilename = (0, utils_1.unifyPath)(file.newName); - if (oldFilename !== newFilename && !isDevNullName(oldFilename) && !isDevNullName(newFilename)) { - var prefixPaths = []; - var suffixPaths = []; - var oldFilenameParts = oldFilename.split(separator); - var newFilenameParts = newFilename.split(separator); - var oldFilenamePartsSize = oldFilenameParts.length; - var newFilenamePartsSize = newFilenameParts.length; - var i = 0; - var j = oldFilenamePartsSize - 1; - var k = newFilenamePartsSize - 1; - while (i < j && i < k) { - if (oldFilenameParts[i] === newFilenameParts[i]) { - prefixPaths.push(newFilenameParts[i]); - i += 1; - } else { - break; - } - } - while (j > i && k > i) { - if (oldFilenameParts[j] === newFilenameParts[k]) { - suffixPaths.unshift(newFilenameParts[k]); - j -= 1; - k -= 1; - } else { - break; - } - } - var finalPrefix = prefixPaths.join(separator); - var finalSuffix = suffixPaths.join(separator); - var oldRemainingPath = oldFilenameParts.slice(i, j + 1).join(separator); - var newRemainingPath = newFilenameParts.slice(i, k + 1).join(separator); - if (finalPrefix.length && finalSuffix.length) { - return finalPrefix + separator + "{" + oldRemainingPath + " \u2192 " + newRemainingPath + "}" + separator + finalSuffix; - } else if (finalPrefix.length) { - return finalPrefix + separator + "{" + oldRemainingPath + " \u2192 " + newRemainingPath + "}"; - } else if (finalSuffix.length) { - return "{" + oldRemainingPath + " \u2192 " + newRemainingPath + "}" + separator + finalSuffix; - } - return oldFilename + " \u2192 " + newFilename; - } else if (!isDevNullName(newFilename)) { - return newFilename; - } else { - return oldFilename; - } - } - exports.filenameDiff = filenameDiff; - function getHtmlId(file) { - return "d2h-" + (0, utils_1.hashCode)(filenameDiff(file)).toString().slice(-6); - } - exports.getHtmlId = getHtmlId; - function getFileIcon(file) { - var templateName = "file-changed"; - if (file.isRename) { - templateName = "file-renamed"; - } else if (file.isCopy) { - templateName = "file-renamed"; - } else if (file.isNew) { - templateName = "file-added"; - } else if (file.isDeleted) { - templateName = "file-deleted"; - } else if (file.newName !== file.oldName) { - templateName = "file-renamed"; - } - return templateName; - } - exports.getFileIcon = getFileIcon; - function diffHighlight(diffLine1, diffLine2, isCombined, config) { - if (config === void 0) { - config = {}; - } - var _a = __assign2(__assign2({}, exports.defaultRenderConfig), config), matching = _a.matching, maxLineLengthHighlight = _a.maxLineLengthHighlight, matchWordsThreshold = _a.matchWordsThreshold, diffStyle = _a.diffStyle; - var line1 = deconstructLine(diffLine1, isCombined, false); - var line2 = deconstructLine(diffLine2, isCombined, false); - if (line1.content.length > maxLineLengthHighlight || line2.content.length > maxLineLengthHighlight) { - return { - oldLine: { - prefix: line1.prefix, - content: escapeForHtml(line1.content) - }, - newLine: { - prefix: line2.prefix, - content: escapeForHtml(line2.content) - } - }; - } - var diff = diffStyle === "char" ? jsDiff.diffChars(line1.content, line2.content) : jsDiff.diffWordsWithSpace(line1.content, line2.content); - var changedWords = []; - if (diffStyle === "word" && matching === "words") { - var removed = diff.filter(function(element2) { - return element2.removed; - }); - var added = diff.filter(function(element2) { - return element2.added; - }); - var chunks = matcher(added, removed); - chunks.forEach(function(chunk) { - if (chunk[0].length === 1 && chunk[1].length === 1) { - var dist = distance(chunk[0][0], chunk[1][0]); - if (dist < matchWordsThreshold) { - changedWords.push(chunk[0][0]); - changedWords.push(chunk[1][0]); - } - } - }); - } - var highlightedLine = diff.reduce(function(highlightedLine2, part) { - var elemType = part.added ? "ins" : part.removed ? "del" : null; - var addClass = changedWords.indexOf(part) > -1 ? ' class="d2h-change"' : ""; - var escapedValue = escapeForHtml(part.value); - return elemType !== null ? highlightedLine2 + "<" + elemType + addClass + ">" + escapedValue + "" : "" + highlightedLine2 + escapedValue; - }, ""); - return { - oldLine: { - prefix: line1.prefix, - content: removeInsElements(highlightedLine) - }, - newLine: { - prefix: line2.prefix, - content: removeDelElements(highlightedLine) - } - }; - } - exports.diffHighlight = diffHighlight; - } -}); - -// node_modules/diff2html/lib/file-list-renderer.js -var require_file_list_renderer = __commonJS({ - "node_modules/diff2html/lib/file-list-renderer.js"(exports) { - "use strict"; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding2(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.render = void 0; - var renderUtils = __importStar2(require_render_utils()); - var baseTemplatesPath = "file-summary"; - var iconsBaseTemplatesPath = "icon"; - function render(diffFiles, hoganUtils) { - var files = diffFiles.map(function(file) { - return hoganUtils.render(baseTemplatesPath, "line", { - fileHtmlId: renderUtils.getHtmlId(file), - oldName: file.oldName, - newName: file.newName, - fileName: renderUtils.filenameDiff(file), - deletedLines: "-" + file.deletedLines, - addedLines: "+" + file.addedLines - }, { - fileIcon: hoganUtils.template(iconsBaseTemplatesPath, renderUtils.getFileIcon(file)) - }); - }).join("\n"); - return hoganUtils.render(baseTemplatesPath, "wrapper", { - filesNumber: diffFiles.length, - files - }); - } - exports.render = render; - } -}); - -// node_modules/diff2html/lib/line-by-line-renderer.js -var require_line_by_line_renderer = __commonJS({ - "node_modules/diff2html/lib/line-by-line-renderer.js"(exports) { - "use strict"; - var __assign2 = exports && exports.__assign || function() { - __assign2 = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign2.apply(this, arguments); - }; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding2(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultLineByLineRendererConfig = void 0; - var Rematch = __importStar2(require_rematch()); - var renderUtils = __importStar2(require_render_utils()); - var types_1 = require_types(); - exports.defaultLineByLineRendererConfig = __assign2(__assign2({}, renderUtils.defaultRenderConfig), { renderNothingWhenEmpty: false, matchingMaxComparisons: 2500, maxLineSizeInBlockForComparison: 200 }); - var genericTemplatesPath = "generic"; - var baseTemplatesPath = "line-by-line"; - var iconsBaseTemplatesPath = "icon"; - var tagsBaseTemplatesPath = "tag"; - var LineByLineRenderer = function() { - function LineByLineRenderer2(hoganUtils, config) { - if (config === void 0) { - config = {}; - } - this.hoganUtils = hoganUtils; - this.config = __assign2(__assign2({}, exports.defaultLineByLineRendererConfig), config); - } - LineByLineRenderer2.prototype.render = function(diffFiles) { - var _this = this; - var diffsHtml = diffFiles.map(function(file) { - var diffs; - if (file.blocks.length) { - diffs = _this.generateFileHtml(file); - } else { - diffs = _this.generateEmptyDiff(); - } - return _this.makeFileDiffHtml(file, diffs); - }).join("\n"); - return this.hoganUtils.render(genericTemplatesPath, "wrapper", { content: diffsHtml }); - }; - LineByLineRenderer2.prototype.makeFileDiffHtml = function(file, diffs) { - if (this.config.renderNothingWhenEmpty && Array.isArray(file.blocks) && file.blocks.length === 0) - return ""; - var fileDiffTemplate = this.hoganUtils.template(baseTemplatesPath, "file-diff"); - var filePathTemplate = this.hoganUtils.template(genericTemplatesPath, "file-path"); - var fileIconTemplate = this.hoganUtils.template(iconsBaseTemplatesPath, "file"); - var fileTagTemplate = this.hoganUtils.template(tagsBaseTemplatesPath, renderUtils.getFileIcon(file)); - return fileDiffTemplate.render({ - file, - fileHtmlId: renderUtils.getHtmlId(file), - diffs, - filePath: filePathTemplate.render({ - fileDiffName: renderUtils.filenameDiff(file) - }, { - fileIcon: fileIconTemplate, - fileTag: fileTagTemplate - }) - }); - }; - LineByLineRenderer2.prototype.generateEmptyDiff = function() { - return this.hoganUtils.render(genericTemplatesPath, "empty-diff", { - contentClass: "d2h-code-line", - CSSLineClass: renderUtils.CSSLineClass - }); - }; - LineByLineRenderer2.prototype.generateFileHtml = function(file) { - var _this = this; - var matcher = Rematch.newMatcherFn(Rematch.newDistanceFn(function(e) { - return renderUtils.deconstructLine(e.content, file.isCombined).content; - })); - return file.blocks.map(function(block) { - var lines = _this.hoganUtils.render(genericTemplatesPath, "block-header", { - CSSLineClass: renderUtils.CSSLineClass, - blockHeader: file.isTooBig ? block.header : renderUtils.escapeForHtml(block.header), - lineClass: "d2h-code-linenumber", - contentClass: "d2h-code-line" - }); - _this.applyLineGroupping(block).forEach(function(_a) { - var contextLines = _a[0], oldLines = _a[1], newLines = _a[2]; - if (oldLines.length && newLines.length && !contextLines.length) { - _this.applyRematchMatching(oldLines, newLines, matcher).map(function(_a2) { - var oldLines2 = _a2[0], newLines2 = _a2[1]; - var _b2 = _this.processChangedLines(file.isCombined, oldLines2, newLines2), left2 = _b2.left, right2 = _b2.right; - lines += left2; - lines += right2; - }); - } else if (contextLines.length) { - contextLines.forEach(function(line) { - var _a2 = renderUtils.deconstructLine(line.content, file.isCombined), prefix = _a2.prefix, content = _a2.content; - lines += _this.generateSingleLineHtml({ - type: renderUtils.CSSLineClass.CONTEXT, - prefix, - content, - oldNumber: line.oldNumber, - newNumber: line.newNumber - }); - }); - } else if (oldLines.length || newLines.length) { - var _b = _this.processChangedLines(file.isCombined, oldLines, newLines), left = _b.left, right = _b.right; - lines += left; - lines += right; - } else { - console.error("Unknown state reached while processing groups of lines", contextLines, oldLines, newLines); - } - }); - return lines; - }).join("\n"); - }; - LineByLineRenderer2.prototype.applyLineGroupping = function(block) { - var blockLinesGroups = []; - var oldLines = []; - var newLines = []; - for (var i = 0; i < block.lines.length; i++) { - var diffLine = block.lines[i]; - if (diffLine.type !== types_1.LineType.INSERT && newLines.length || diffLine.type === types_1.LineType.CONTEXT && oldLines.length > 0) { - blockLinesGroups.push([[], oldLines, newLines]); - oldLines = []; - newLines = []; - } - if (diffLine.type === types_1.LineType.CONTEXT) { - blockLinesGroups.push([[diffLine], [], []]); - } else if (diffLine.type === types_1.LineType.INSERT && oldLines.length === 0) { - blockLinesGroups.push([[], [], [diffLine]]); - } else if (diffLine.type === types_1.LineType.INSERT && oldLines.length > 0) { - newLines.push(diffLine); - } else if (diffLine.type === types_1.LineType.DELETE) { - oldLines.push(diffLine); - } - } - if (oldLines.length || newLines.length) { - blockLinesGroups.push([[], oldLines, newLines]); - oldLines = []; - newLines = []; - } - return blockLinesGroups; - }; - LineByLineRenderer2.prototype.applyRematchMatching = function(oldLines, newLines, matcher) { - var comparisons = oldLines.length * newLines.length; - var maxLineSizeInBlock = Math.max.apply(null, [0].concat(oldLines.concat(newLines).map(function(elem) { - return elem.content.length; - }))); - var doMatching = comparisons < this.config.matchingMaxComparisons && maxLineSizeInBlock < this.config.maxLineSizeInBlockForComparison && (this.config.matching === "lines" || this.config.matching === "words"); - return doMatching ? matcher(oldLines, newLines) : [[oldLines, newLines]]; - }; - LineByLineRenderer2.prototype.processChangedLines = function(isCombined, oldLines, newLines) { - var fileHtml = { - right: "", - left: "" - }; - var maxLinesNumber = Math.max(oldLines.length, newLines.length); - for (var i = 0; i < maxLinesNumber; i++) { - var oldLine = oldLines[i]; - var newLine = newLines[i]; - var diff = oldLine !== void 0 && newLine !== void 0 ? renderUtils.diffHighlight(oldLine.content, newLine.content, isCombined, this.config) : void 0; - var preparedOldLine = oldLine !== void 0 && oldLine.oldNumber !== void 0 ? __assign2(__assign2({}, diff !== void 0 ? { - prefix: diff.oldLine.prefix, - content: diff.oldLine.content, - type: renderUtils.CSSLineClass.DELETE_CHANGES - } : __assign2(__assign2({}, renderUtils.deconstructLine(oldLine.content, isCombined)), { type: renderUtils.toCSSClass(oldLine.type) })), { oldNumber: oldLine.oldNumber, newNumber: oldLine.newNumber }) : void 0; - var preparedNewLine = newLine !== void 0 && newLine.newNumber !== void 0 ? __assign2(__assign2({}, diff !== void 0 ? { - prefix: diff.newLine.prefix, - content: diff.newLine.content, - type: renderUtils.CSSLineClass.INSERT_CHANGES - } : __assign2(__assign2({}, renderUtils.deconstructLine(newLine.content, isCombined)), { type: renderUtils.toCSSClass(newLine.type) })), { oldNumber: newLine.oldNumber, newNumber: newLine.newNumber }) : void 0; - var _a = this.generateLineHtml(preparedOldLine, preparedNewLine), left = _a.left, right = _a.right; - fileHtml.left += left; - fileHtml.right += right; - } - return fileHtml; - }; - LineByLineRenderer2.prototype.generateLineHtml = function(oldLine, newLine) { - return { - left: this.generateSingleLineHtml(oldLine), - right: this.generateSingleLineHtml(newLine) - }; - }; - LineByLineRenderer2.prototype.generateSingleLineHtml = function(line) { - if (line === void 0) - return ""; - var lineNumberHtml = this.hoganUtils.render(baseTemplatesPath, "numbers", { - oldNumber: line.oldNumber || "", - newNumber: line.newNumber || "" - }); - return this.hoganUtils.render(genericTemplatesPath, "line", { - type: line.type, - lineClass: "d2h-code-linenumber", - contentClass: "d2h-code-line", - prefix: line.prefix === " " ? " " : line.prefix, - content: line.content, - lineNumber: lineNumberHtml - }); - }; - return LineByLineRenderer2; - }(); - exports.default = LineByLineRenderer; - } -}); - -// node_modules/diff2html/lib/side-by-side-renderer.js -var require_side_by_side_renderer = __commonJS({ - "node_modules/diff2html/lib/side-by-side-renderer.js"(exports) { - "use strict"; - var __assign2 = exports && exports.__assign || function() { - __assign2 = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign2.apply(this, arguments); - }; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding2(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultSideBySideRendererConfig = void 0; - var Rematch = __importStar2(require_rematch()); - var renderUtils = __importStar2(require_render_utils()); - var types_1 = require_types(); - exports.defaultSideBySideRendererConfig = __assign2(__assign2({}, renderUtils.defaultRenderConfig), { renderNothingWhenEmpty: false, matchingMaxComparisons: 2500, maxLineSizeInBlockForComparison: 200 }); - var genericTemplatesPath = "generic"; - var baseTemplatesPath = "side-by-side"; - var iconsBaseTemplatesPath = "icon"; - var tagsBaseTemplatesPath = "tag"; - var SideBySideRenderer = function() { - function SideBySideRenderer2(hoganUtils, config) { - if (config === void 0) { - config = {}; - } - this.hoganUtils = hoganUtils; - this.config = __assign2(__assign2({}, exports.defaultSideBySideRendererConfig), config); - } - SideBySideRenderer2.prototype.render = function(diffFiles) { - var _this = this; - var diffsHtml = diffFiles.map(function(file) { - var diffs; - if (file.blocks.length) { - diffs = _this.generateFileHtml(file); - } else { - diffs = _this.generateEmptyDiff(); - } - return _this.makeFileDiffHtml(file, diffs); - }).join("\n"); - return this.hoganUtils.render(genericTemplatesPath, "wrapper", { content: diffsHtml }); - }; - SideBySideRenderer2.prototype.makeFileDiffHtml = function(file, diffs) { - if (this.config.renderNothingWhenEmpty && Array.isArray(file.blocks) && file.blocks.length === 0) - return ""; - var fileDiffTemplate = this.hoganUtils.template(baseTemplatesPath, "file-diff"); - var filePathTemplate = this.hoganUtils.template(genericTemplatesPath, "file-path"); - var fileIconTemplate = this.hoganUtils.template(iconsBaseTemplatesPath, "file"); - var fileTagTemplate = this.hoganUtils.template(tagsBaseTemplatesPath, renderUtils.getFileIcon(file)); - return fileDiffTemplate.render({ - file, - fileHtmlId: renderUtils.getHtmlId(file), - diffs, - filePath: filePathTemplate.render({ - fileDiffName: renderUtils.filenameDiff(file) - }, { - fileIcon: fileIconTemplate, - fileTag: fileTagTemplate - }) - }); - }; - SideBySideRenderer2.prototype.generateEmptyDiff = function() { - return { - right: "", - left: this.hoganUtils.render(genericTemplatesPath, "empty-diff", { - contentClass: "d2h-code-side-line", - CSSLineClass: renderUtils.CSSLineClass - }) - }; - }; - SideBySideRenderer2.prototype.generateFileHtml = function(file) { - var _this = this; - var matcher = Rematch.newMatcherFn(Rematch.newDistanceFn(function(e) { - return renderUtils.deconstructLine(e.content, file.isCombined).content; - })); - return file.blocks.map(function(block) { - var fileHtml = { - left: _this.makeHeaderHtml(block.header, file), - right: _this.makeHeaderHtml("") - }; - _this.applyLineGroupping(block).forEach(function(_a) { - var contextLines = _a[0], oldLines = _a[1], newLines = _a[2]; - if (oldLines.length && newLines.length && !contextLines.length) { - _this.applyRematchMatching(oldLines, newLines, matcher).map(function(_a2) { - var oldLines2 = _a2[0], newLines2 = _a2[1]; - var _b2 = _this.processChangedLines(file.isCombined, oldLines2, newLines2), left2 = _b2.left, right2 = _b2.right; - fileHtml.left += left2; - fileHtml.right += right2; - }); - } else if (contextLines.length) { - contextLines.forEach(function(line) { - var _a2 = renderUtils.deconstructLine(line.content, file.isCombined), prefix = _a2.prefix, content = _a2.content; - var _b2 = _this.generateLineHtml({ - type: renderUtils.CSSLineClass.CONTEXT, - prefix, - content, - number: line.oldNumber - }, { - type: renderUtils.CSSLineClass.CONTEXT, - prefix, - content, - number: line.newNumber - }), left2 = _b2.left, right2 = _b2.right; - fileHtml.left += left2; - fileHtml.right += right2; - }); - } else if (oldLines.length || newLines.length) { - var _b = _this.processChangedLines(file.isCombined, oldLines, newLines), left = _b.left, right = _b.right; - fileHtml.left += left; - fileHtml.right += right; - } else { - console.error("Unknown state reached while processing groups of lines", contextLines, oldLines, newLines); - } - }); - return fileHtml; - }).reduce(function(accomulated, html2) { - return { left: accomulated.left + html2.left, right: accomulated.right + html2.right }; - }, { left: "", right: "" }); - }; - SideBySideRenderer2.prototype.applyLineGroupping = function(block) { - var blockLinesGroups = []; - var oldLines = []; - var newLines = []; - for (var i = 0; i < block.lines.length; i++) { - var diffLine = block.lines[i]; - if (diffLine.type !== types_1.LineType.INSERT && newLines.length || diffLine.type === types_1.LineType.CONTEXT && oldLines.length > 0) { - blockLinesGroups.push([[], oldLines, newLines]); - oldLines = []; - newLines = []; - } - if (diffLine.type === types_1.LineType.CONTEXT) { - blockLinesGroups.push([[diffLine], [], []]); - } else if (diffLine.type === types_1.LineType.INSERT && oldLines.length === 0) { - blockLinesGroups.push([[], [], [diffLine]]); - } else if (diffLine.type === types_1.LineType.INSERT && oldLines.length > 0) { - newLines.push(diffLine); - } else if (diffLine.type === types_1.LineType.DELETE) { - oldLines.push(diffLine); - } - } - if (oldLines.length || newLines.length) { - blockLinesGroups.push([[], oldLines, newLines]); - oldLines = []; - newLines = []; - } - return blockLinesGroups; - }; - SideBySideRenderer2.prototype.applyRematchMatching = function(oldLines, newLines, matcher) { - var comparisons = oldLines.length * newLines.length; - var maxLineSizeInBlock = Math.max.apply(null, [0].concat(oldLines.concat(newLines).map(function(elem) { - return elem.content.length; - }))); - var doMatching = comparisons < this.config.matchingMaxComparisons && maxLineSizeInBlock < this.config.maxLineSizeInBlockForComparison && (this.config.matching === "lines" || this.config.matching === "words"); - return doMatching ? matcher(oldLines, newLines) : [[oldLines, newLines]]; - }; - SideBySideRenderer2.prototype.makeHeaderHtml = function(blockHeader, file) { - return this.hoganUtils.render(genericTemplatesPath, "block-header", { - CSSLineClass: renderUtils.CSSLineClass, - blockHeader: (file === null || file === void 0 ? void 0 : file.isTooBig) ? blockHeader : renderUtils.escapeForHtml(blockHeader), - lineClass: "d2h-code-side-linenumber", - contentClass: "d2h-code-side-line" - }); - }; - SideBySideRenderer2.prototype.processChangedLines = function(isCombined, oldLines, newLines) { - var fileHtml = { - right: "", - left: "" - }; - var maxLinesNumber = Math.max(oldLines.length, newLines.length); - for (var i = 0; i < maxLinesNumber; i++) { - var oldLine = oldLines[i]; - var newLine = newLines[i]; - var diff = oldLine !== void 0 && newLine !== void 0 ? renderUtils.diffHighlight(oldLine.content, newLine.content, isCombined, this.config) : void 0; - var preparedOldLine = oldLine !== void 0 && oldLine.oldNumber !== void 0 ? __assign2(__assign2({}, diff !== void 0 ? { - prefix: diff.oldLine.prefix, - content: diff.oldLine.content, - type: renderUtils.CSSLineClass.DELETE_CHANGES - } : __assign2(__assign2({}, renderUtils.deconstructLine(oldLine.content, isCombined)), { type: renderUtils.toCSSClass(oldLine.type) })), { number: oldLine.oldNumber }) : void 0; - var preparedNewLine = newLine !== void 0 && newLine.newNumber !== void 0 ? __assign2(__assign2({}, diff !== void 0 ? { - prefix: diff.newLine.prefix, - content: diff.newLine.content, - type: renderUtils.CSSLineClass.INSERT_CHANGES - } : __assign2(__assign2({}, renderUtils.deconstructLine(newLine.content, isCombined)), { type: renderUtils.toCSSClass(newLine.type) })), { number: newLine.newNumber }) : void 0; - var _a = this.generateLineHtml(preparedOldLine, preparedNewLine), left = _a.left, right = _a.right; - fileHtml.left += left; - fileHtml.right += right; - } - return fileHtml; - }; - SideBySideRenderer2.prototype.generateLineHtml = function(oldLine, newLine) { - return { - left: this.generateSingleHtml(oldLine), - right: this.generateSingleHtml(newLine) - }; - }; - SideBySideRenderer2.prototype.generateSingleHtml = function(line) { - var lineClass = "d2h-code-side-linenumber"; - var contentClass = "d2h-code-side-line"; - return this.hoganUtils.render(genericTemplatesPath, "line", { - type: (line === null || line === void 0 ? void 0 : line.type) || renderUtils.CSSLineClass.CONTEXT + " d2h-emptyplaceholder", - lineClass: line !== void 0 ? lineClass : lineClass + " d2h-code-side-emptyplaceholder", - contentClass: line !== void 0 ? contentClass : contentClass + " d2h-code-side-emptyplaceholder", - prefix: (line === null || line === void 0 ? void 0 : line.prefix) === " " ? " " : line === null || line === void 0 ? void 0 : line.prefix, - content: line === null || line === void 0 ? void 0 : line.content, - lineNumber: line === null || line === void 0 ? void 0 : line.number - }); - }; - return SideBySideRenderer2; - }(); - exports.default = SideBySideRenderer; - } -}); - -// node_modules/hogan.js/lib/compiler.js -var require_compiler = __commonJS({ - "node_modules/hogan.js/lib/compiler.js"(exports) { - (function(Hogan2) { - var rIsWhitespace = /\S/, rQuot = /\"/g, rNewline = /\n/g, rCr = /\r/g, rSlash = /\\/g, rLineSep = /\u2028/, rParagraphSep = /\u2029/; - Hogan2.tags = { - "#": 1, - "^": 2, - "<": 3, - "$": 4, - "/": 5, - "!": 6, - ">": 7, - "=": 8, - "_v": 9, - "{": 10, - "&": 11, - "_t": 12 - }; - Hogan2.scan = function scan(text2, delimiters) { - var len = text2.length, IN_TEXT = 0, IN_TAG_TYPE = 1, IN_TAG = 2, state = IN_TEXT, tagType = null, tag = null, buf = "", tokens = [], seenTag = false, i = 0, lineStart = 0, otag = "{{", ctag = "}}"; - function addBuf() { - if (buf.length > 0) { - tokens.push({ tag: "_t", text: new String(buf) }); - buf = ""; - } - } - function lineIsWhitespace() { - var isAllWhitespace = true; - for (var j = lineStart; j < tokens.length; j++) { - isAllWhitespace = Hogan2.tags[tokens[j].tag] < Hogan2.tags["_v"] || tokens[j].tag == "_t" && tokens[j].text.match(rIsWhitespace) === null; - if (!isAllWhitespace) { - return false; - } - } - return isAllWhitespace; - } - function filterLine(haveSeenTag, noNewLine) { - addBuf(); - if (haveSeenTag && lineIsWhitespace()) { - for (var j = lineStart, next; j < tokens.length; j++) { - if (tokens[j].text) { - if ((next = tokens[j + 1]) && next.tag == ">") { - next.indent = tokens[j].text.toString(); - } - tokens.splice(j, 1); - } - } - } else if (!noNewLine) { - tokens.push({ tag: "\n" }); - } - seenTag = false; - lineStart = tokens.length; - } - function changeDelimiters(text3, index) { - var close = "=" + ctag, closeIndex = text3.indexOf(close, index), delimiters2 = trim(text3.substring(text3.indexOf("=", index) + 1, closeIndex)).split(" "); - otag = delimiters2[0]; - ctag = delimiters2[delimiters2.length - 1]; - return closeIndex + close.length - 1; - } - if (delimiters) { - delimiters = delimiters.split(" "); - otag = delimiters[0]; - ctag = delimiters[1]; - } - for (i = 0; i < len; i++) { - if (state == IN_TEXT) { - if (tagChange(otag, text2, i)) { - --i; - addBuf(); - state = IN_TAG_TYPE; - } else { - if (text2.charAt(i) == "\n") { - filterLine(seenTag); - } else { - buf += text2.charAt(i); - } - } - } else if (state == IN_TAG_TYPE) { - i += otag.length - 1; - tag = Hogan2.tags[text2.charAt(i + 1)]; - tagType = tag ? text2.charAt(i + 1) : "_v"; - if (tagType == "=") { - i = changeDelimiters(text2, i); - state = IN_TEXT; - } else { - if (tag) { - i++; - } - state = IN_TAG; - } - seenTag = i; - } else { - if (tagChange(ctag, text2, i)) { - tokens.push({ - tag: tagType, - n: trim(buf), - otag, - ctag, - i: tagType == "/" ? seenTag - otag.length : i + ctag.length - }); - buf = ""; - i += ctag.length - 1; - state = IN_TEXT; - if (tagType == "{") { - if (ctag == "}}") { - i++; - } else { - cleanTripleStache(tokens[tokens.length - 1]); - } - } - } else { - buf += text2.charAt(i); - } - } - } - filterLine(seenTag, true); - return tokens; - }; - function cleanTripleStache(token) { - if (token.n.substr(token.n.length - 1) === "}") { - token.n = token.n.substring(0, token.n.length - 1); - } - } - function trim(s) { - if (s.trim) { - return s.trim(); - } - return s.replace(/^\s*|\s*$/g, ""); - } - function tagChange(tag, text2, index) { - if (text2.charAt(index) != tag.charAt(0)) { - return false; - } - for (var i = 1, l = tag.length; i < l; i++) { - if (text2.charAt(index + i) != tag.charAt(i)) { - return false; - } - } - return true; - } - var allowedInSuper = { "_t": true, "\n": true, "$": true, "/": true }; - function buildTree(tokens, kind, stack, customTags) { - var instructions = [], opener = null, tail = null, token = null; - tail = stack[stack.length - 1]; - while (tokens.length > 0) { - token = tokens.shift(); - if (tail && tail.tag == "<" && !(token.tag in allowedInSuper)) { - throw new Error("Illegal content in < super tag."); - } - if (Hogan2.tags[token.tag] <= Hogan2.tags["$"] || isOpener(token, customTags)) { - stack.push(token); - token.nodes = buildTree(tokens, token.tag, stack, customTags); - } else if (token.tag == "/") { - if (stack.length === 0) { - throw new Error("Closing tag without opener: /" + token.n); - } - opener = stack.pop(); - if (token.n != opener.n && !isCloser(token.n, opener.n, customTags)) { - throw new Error("Nesting error: " + opener.n + " vs. " + token.n); - } - opener.end = token.i; - return instructions; - } else if (token.tag == "\n") { - token.last = tokens.length == 0 || tokens[0].tag == "\n"; - } - instructions.push(token); - } - if (stack.length > 0) { - throw new Error("missing closing tag: " + stack.pop().n); - } - return instructions; - } - function isOpener(token, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].o == token.n) { - token.tag = "#"; - return true; - } - } - } - function isCloser(close, open, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].c == close && tags[i].o == open) { - return true; - } - } - } - function stringifySubstitutions(obj) { - var items = []; - for (var key2 in obj) { - items.push('"' + esc(key2) + '": function(c,p,t,i) {' + obj[key2] + "}"); - } - return "{ " + items.join(",") + " }"; - } - function stringifyPartials(codeObj) { - var partials = []; - for (var key2 in codeObj.partials) { - partials.push('"' + esc(key2) + '":{name:"' + esc(codeObj.partials[key2].name) + '", ' + stringifyPartials(codeObj.partials[key2]) + "}"); - } - return "partials: {" + partials.join(",") + "}, subs: " + stringifySubstitutions(codeObj.subs); - } - Hogan2.stringify = function(codeObj, text2, options) { - return "{code: function (c,p,i) { " + Hogan2.wrapMain(codeObj.code) + " }," + stringifyPartials(codeObj) + "}"; - }; - var serialNo = 0; - Hogan2.generate = function(tree, text2, options) { - serialNo = 0; - var context = { code: "", subs: {}, partials: {} }; - Hogan2.walk(tree, context); - if (options.asString) { - return this.stringify(context, text2, options); - } - return this.makeTemplate(context, text2, options); - }; - Hogan2.wrapMain = function(code) { - return 'var t=this;t.b(i=i||"");' + code + "return t.fl();"; - }; - Hogan2.template = Hogan2.Template; - Hogan2.makeTemplate = function(codeObj, text2, options) { - var template = this.makePartials(codeObj); - template.code = new Function("c", "p", "i", this.wrapMain(codeObj.code)); - return new this.template(template, text2, this, options); - }; - Hogan2.makePartials = function(codeObj) { - var key2, template = { subs: {}, partials: codeObj.partials, name: codeObj.name }; - for (key2 in template.partials) { - template.partials[key2] = this.makePartials(template.partials[key2]); - } - for (key2 in codeObj.subs) { - template.subs[key2] = new Function("c", "p", "t", "i", codeObj.subs[key2]); - } - return template; - }; - function esc(s) { - return s.replace(rSlash, "\\\\").replace(rQuot, '\\"').replace(rNewline, "\\n").replace(rCr, "\\r").replace(rLineSep, "\\u2028").replace(rParagraphSep, "\\u2029"); - } - function chooseMethod(s) { - return ~s.indexOf(".") ? "d" : "f"; - } - function createPartial(node, context) { - var prefix = "<" + (context.prefix || ""); - var sym = prefix + node.n + serialNo++; - context.partials[sym] = { name: node.n, partials: {} }; - context.code += 't.b(t.rp("' + esc(sym) + '",c,p,"' + (node.indent || "") + '"));'; - return sym; - } - Hogan2.codegen = { - "#": function(node, context) { - context.code += "if(t.s(t." + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,1),c,p,0,' + node.i + "," + node.end + ',"' + node.otag + " " + node.ctag + '")){t.rs(c,p,function(c,p,t){'; - Hogan2.walk(node.nodes, context); - context.code += "});c.pop();}"; - }, - "^": function(node, context) { - context.code += "if(!t.s(t." + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,1),c,p,1,0,0,"")){'; - Hogan2.walk(node.nodes, context); - context.code += "};"; - }, - ">": createPartial, - "<": function(node, context) { - var ctx = { partials: {}, code: "", subs: {}, inPartial: true }; - Hogan2.walk(node.nodes, ctx); - var template = context.partials[createPartial(node, context)]; - template.subs = ctx.subs; - template.partials = ctx.partials; - }, - "$": function(node, context) { - var ctx = { subs: {}, code: "", partials: context.partials, prefix: node.n }; - Hogan2.walk(node.nodes, ctx); - context.subs[node.n] = ctx.code; - if (!context.inPartial) { - context.code += 't.sub("' + esc(node.n) + '",c,p,i);'; - } - }, - "\n": function(node, context) { - context.code += write('"\\n"' + (node.last ? "" : " + i")); - }, - "_v": function(node, context) { - context.code += "t.b(t.v(t." + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,0)));'; - }, - "_t": function(node, context) { - context.code += write('"' + esc(node.text) + '"'); - }, - "{": tripleStache, - "&": tripleStache - }; - function tripleStache(node, context) { - context.code += "t.b(t.t(t." + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,0)));'; - } - function write(s) { - return "t.b(" + s + ");"; - } - Hogan2.walk = function(nodelist, context) { - var func; - for (var i = 0, l = nodelist.length; i < l; i++) { - func = Hogan2.codegen[nodelist[i].tag]; - func && func(nodelist[i], context); - } - return context; - }; - Hogan2.parse = function(tokens, text2, options) { - options = options || {}; - return buildTree(tokens, "", [], options.sectionTags || []); - }; - Hogan2.cache = {}; - Hogan2.cacheKey = function(text2, options) { - return [text2, !!options.asString, !!options.disableLambda, options.delimiters, !!options.modelGet].join("||"); - }; - Hogan2.compile = function(text2, options) { - options = options || {}; - var key2 = Hogan2.cacheKey(text2, options); - var template = this.cache[key2]; - if (template) { - var partials = template.partials; - for (var name in partials) { - delete partials[name].instance; - } - return template; - } - template = this.generate(this.parse(this.scan(text2, options.delimiters), text2, options), text2, options); - return this.cache[key2] = template; - }; - })(typeof exports !== "undefined" ? exports : Hogan); - } -}); - -// node_modules/hogan.js/lib/template.js -var require_template = __commonJS({ - "node_modules/hogan.js/lib/template.js"(exports) { - var Hogan2 = {}; - (function(Hogan3) { - Hogan3.Template = function(codeObj, text2, compiler, options) { - codeObj = codeObj || {}; - this.r = codeObj.code || this.r; - this.c = compiler; - this.options = options || {}; - this.text = text2 || ""; - this.partials = codeObj.partials || {}; - this.subs = codeObj.subs || {}; - this.buf = ""; - }; - Hogan3.Template.prototype = { - r: function(context, partials, indent) { - return ""; - }, - v: hoganEscape, - t: coerceToString, - render: function render(context, partials, indent) { - return this.ri([context], partials || {}, indent); - }, - ri: function(context, partials, indent) { - return this.r(context, partials, indent); - }, - ep: function(symbol, partials) { - var partial = this.partials[symbol]; - var template = partials[partial.name]; - if (partial.instance && partial.base == template) { - return partial.instance; - } - if (typeof template == "string") { - if (!this.c) { - throw new Error("No compiler available."); - } - template = this.c.compile(template, this.options); - } - if (!template) { - return null; - } - this.partials[symbol].base = template; - if (partial.subs) { - if (!partials.stackText) - partials.stackText = {}; - for (key in partial.subs) { - if (!partials.stackText[key]) { - partials.stackText[key] = this.activeSub !== void 0 && partials.stackText[this.activeSub] ? partials.stackText[this.activeSub] : this.text; - } - } - template = createSpecializedPartial(template, partial.subs, partial.partials, this.stackSubs, this.stackPartials, partials.stackText); - } - this.partials[symbol].instance = template; - return template; - }, - rp: function(symbol, context, partials, indent) { - var partial = this.ep(symbol, partials); - if (!partial) { - return ""; - } - return partial.ri(context, partials, indent); - }, - rs: function(context, partials, section) { - var tail = context[context.length - 1]; - if (!isArray(tail)) { - section(context, partials, this); - return; - } - for (var i = 0; i < tail.length; i++) { - context.push(tail[i]); - section(context, partials, this); - context.pop(); - } - }, - s: function(val, ctx, partials, inverted, start, end, tags) { - var pass; - if (isArray(val) && val.length === 0) { - return false; - } - if (typeof val == "function") { - val = this.ms(val, ctx, partials, inverted, start, end, tags); - } - pass = !!val; - if (!inverted && pass && ctx) { - ctx.push(typeof val == "object" ? val : ctx[ctx.length - 1]); - } - return pass; - }, - d: function(key2, ctx, partials, returnFound) { - var found, names = key2.split("."), val = this.f(names[0], ctx, partials, returnFound), doModelGet = this.options.modelGet, cx = null; - if (key2 === "." && isArray(ctx[ctx.length - 2])) { - val = ctx[ctx.length - 1]; - } else { - for (var i = 1; i < names.length; i++) { - found = findInScope(names[i], val, doModelGet); - if (found !== void 0) { - cx = val; - val = found; - } else { - val = ""; - } - } - } - if (returnFound && !val) { - return false; - } - if (!returnFound && typeof val == "function") { - ctx.push(cx); - val = this.mv(val, ctx, partials); - ctx.pop(); - } - return val; - }, - f: function(key2, ctx, partials, returnFound) { - var val = false, v = null, found = false, doModelGet = this.options.modelGet; - for (var i = ctx.length - 1; i >= 0; i--) { - v = ctx[i]; - val = findInScope(key2, v, doModelGet); - if (val !== void 0) { - found = true; - break; - } - } - if (!found) { - return returnFound ? false : ""; - } - if (!returnFound && typeof val == "function") { - val = this.mv(val, ctx, partials); - } - return val; - }, - ls: function(func, cx, partials, text2, tags) { - var oldTags = this.options.delimiters; - this.options.delimiters = tags; - this.b(this.ct(coerceToString(func.call(cx, text2)), cx, partials)); - this.options.delimiters = oldTags; - return false; - }, - ct: function(text2, cx, partials) { - if (this.options.disableLambda) { - throw new Error("Lambda features disabled."); - } - return this.c.compile(text2, this.options).render(cx, partials); - }, - b: function(s) { - this.buf += s; - }, - fl: function() { - var r = this.buf; - this.buf = ""; - return r; - }, - ms: function(func, ctx, partials, inverted, start, end, tags) { - var textSource, cx = ctx[ctx.length - 1], result = func.call(cx); - if (typeof result == "function") { - if (inverted) { - return true; - } else { - textSource = this.activeSub && this.subsText && this.subsText[this.activeSub] ? this.subsText[this.activeSub] : this.text; - return this.ls(result, cx, partials, textSource.substring(start, end), tags); - } - } - return result; - }, - mv: function(func, ctx, partials) { - var cx = ctx[ctx.length - 1]; - var result = func.call(cx); - if (typeof result == "function") { - return this.ct(coerceToString(result.call(cx)), cx, partials); - } - return result; - }, - sub: function(name, context, partials, indent) { - var f = this.subs[name]; - if (f) { - this.activeSub = name; - f(context, partials, this, indent); - this.activeSub = false; - } - } - }; - function findInScope(key2, scope, doModelGet) { - var val; - if (scope && typeof scope == "object") { - if (scope[key2] !== void 0) { - val = scope[key2]; - } else if (doModelGet && scope.get && typeof scope.get == "function") { - val = scope.get(key2); - } - } - return val; - } - function createSpecializedPartial(instance5, subs, partials, stackSubs, stackPartials, stackText) { - function PartialTemplate() { - } - ; - PartialTemplate.prototype = instance5; - function Substitutions() { - } - ; - Substitutions.prototype = instance5.subs; - var key2; - var partial = new PartialTemplate(); - partial.subs = new Substitutions(); - partial.subsText = {}; - partial.buf = ""; - stackSubs = stackSubs || {}; - partial.stackSubs = stackSubs; - partial.subsText = stackText; - for (key2 in subs) { - if (!stackSubs[key2]) - stackSubs[key2] = subs[key2]; - } - for (key2 in stackSubs) { - partial.subs[key2] = stackSubs[key2]; - } - stackPartials = stackPartials || {}; - partial.stackPartials = stackPartials; - for (key2 in partials) { - if (!stackPartials[key2]) - stackPartials[key2] = partials[key2]; - } - for (key2 in stackPartials) { - partial.partials[key2] = stackPartials[key2]; - } - return partial; - } - var rAmp = /&/g, rLt = //g, rApos = /\'/g, rQuot = /\"/g, hChars = /[&<>\"\']/; - function coerceToString(val) { - return String(val === null || val === void 0 ? "" : val); - } - function hoganEscape(str) { - str = coerceToString(str); - return hChars.test(str) ? str.replace(rAmp, "&").replace(rLt, "<").replace(rGt, ">").replace(rApos, "'").replace(rQuot, """) : str; - } - var isArray = Array.isArray || function(a) { - return Object.prototype.toString.call(a) === "[object Array]"; - }; - })(typeof exports !== "undefined" ? exports : Hogan2); - } -}); - -// node_modules/hogan.js/lib/hogan.js -var require_hogan = __commonJS({ - "node_modules/hogan.js/lib/hogan.js"(exports, module2) { - var Hogan2 = require_compiler(); - Hogan2.Template = require_template().Template; - Hogan2.template = Hogan2.Template; - module2.exports = Hogan2; - } -}); - -// node_modules/diff2html/lib/diff2html-templates.js -var require_diff2html_templates = __commonJS({ - "node_modules/diff2html/lib/diff2html-templates.js"(exports) { - "use strict"; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding2(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultTemplates = void 0; - var Hogan2 = __importStar2(require_hogan()); - exports.defaultTemplates = {}; - exports.defaultTemplates["file-summary-line"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('
  • '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(t.rp("'); - t.b(t.v(t.f("fileName", c, p, 0))); - t.b(""); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(' '); - t.b(t.v(t.f("addedLines", c, p, 0))); - t.b(""); - t.b("\n" + i); - t.b(' '); - t.b(t.v(t.f("deletedLines", c, p, 0))); - t.b(""); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b("
  • "); - return t.fl(); - }, partials: { "'); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(' Files changed ('); - t.b(t.v(t.f("filesNumber", c, p, 0))); - t.b(")"); - t.b("\n" + i); - t.b(' hide'); - t.b("\n" + i); - t.b(' show'); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b('
      '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.f("files", c, p, 0))); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b(""); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["generic-block-header"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b(""); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b('
    '); - t.b(t.t(t.f("blockHeader", c, p, 0))); - t.b("
    "); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b(""); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["generic-empty-diff"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b(""); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(" File without changes"); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b(""); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["generic-file-path"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b(''); - t.b("\n" + i); - t.b(t.rp("'); - t.b(t.v(t.f("fileDiffName", c, p, 0))); - t.b(""); - t.b("\n" + i); - t.b(t.rp(""); - t.b("\n" + i); - t.b('"); - return t.fl(); - }, partials: { ""); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.f("lineNumber", c, p, 0))); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - if (t.s(t.f("prefix", c, p, 1), c, p, 0, 162, 238, "{{ }}")) { - t.rs(c, p, function(c2, p2, t2) { - t2.b(' '); - t2.b(t2.t(t2.f("prefix", c2, p2, 0))); - t2.b(""); - t2.b("\n" + i); - }); - c.pop(); - } - if (!t.s(t.f("prefix", c, p, 1), c, p, 1, 0, 0, "")) { - t.b('  '); - t.b("\n" + i); - } - ; - if (t.s(t.f("content", c, p, 1), c, p, 0, 371, 445, "{{ }}")) { - t.rs(c, p, function(c2, p2, t2) { - t2.b(' '); - t2.b(t2.t(t2.f("content", c2, p2, 0))); - t2.b(""); - t2.b("\n" + i); - }); - c.pop(); - } - if (!t.s(t.f("content", c, p, 1), c, p, 1, 0, 0, "")) { - t.b('
    '); - t.b("\n" + i); - } - ; - t.b("
    "); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b(""); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["generic-wrapper"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('
    '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.f("content", c, p, 0))); - t.b("\n" + i); - t.b("
    "); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["icon-file-added"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('"); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["icon-file-changed"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('"); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["icon-file-deleted"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('"); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["icon-file-renamed"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('"); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["icon-file"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('"); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["line-by-line-file-diff"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('
    '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.f("filePath", c, p, 0))); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.f("diffs", c, p, 0))); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["line-by-line-numbers"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('
    '); - t.b(t.v(t.f("oldNumber", c, p, 0))); - t.b("
    "); - t.b("\n" + i); - t.b('
    '); - t.b(t.v(t.f("newNumber", c, p, 0))); - t.b("
    "); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["side-by-side-file-diff"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('
    '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.f("filePath", c, p, 0))); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.d("diffs.left", c, p, 0))); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.d("diffs.right", c, p, 0))); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["tag-file-added"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('ADDED'); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["tag-file-changed"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('CHANGED'); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["tag-file-deleted"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('DELETED'); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["tag-file-renamed"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('RENAMED'); - return t.fl(); - }, partials: {}, subs: {} }); - } -}); - -// node_modules/diff2html/lib/hoganjs-utils.js -var require_hoganjs_utils = __commonJS({ - "node_modules/diff2html/lib/hoganjs-utils.js"(exports) { - "use strict"; - var __assign2 = exports && exports.__assign || function() { - __assign2 = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign2.apply(this, arguments); - }; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding2(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - var Hogan2 = __importStar2(require_hogan()); - var diff2html_templates_1 = require_diff2html_templates(); - var HoganJsUtils = function() { - function HoganJsUtils2(_a) { - var _b = _a.compiledTemplates, compiledTemplates = _b === void 0 ? {} : _b, _c = _a.rawTemplates, rawTemplates = _c === void 0 ? {} : _c; - var compiledRawTemplates = Object.entries(rawTemplates).reduce(function(previousTemplates, _a2) { - var _b2; - var name = _a2[0], templateString = _a2[1]; - var compiledTemplate = Hogan2.compile(templateString, { asString: false }); - return __assign2(__assign2({}, previousTemplates), (_b2 = {}, _b2[name] = compiledTemplate, _b2)); - }, {}); - this.preCompiledTemplates = __assign2(__assign2(__assign2({}, diff2html_templates_1.defaultTemplates), compiledTemplates), compiledRawTemplates); - } - HoganJsUtils2.compile = function(templateString) { - return Hogan2.compile(templateString, { asString: false }); - }; - HoganJsUtils2.prototype.render = function(namespace, view, params, partials, indent) { - var templateKey = this.templateKey(namespace, view); - try { - var template = this.preCompiledTemplates[templateKey]; - return template.render(params, partials, indent); - } catch (e) { - throw new Error("Could not find template to render '" + templateKey + "'"); - } - }; - HoganJsUtils2.prototype.template = function(namespace, view) { - return this.preCompiledTemplates[this.templateKey(namespace, view)]; - }; - HoganJsUtils2.prototype.templateKey = function(namespace, view) { - return namespace + "-" + view; - }; - return HoganJsUtils2; - }(); - exports.default = HoganJsUtils; - } -}); - -// node_modules/diff2html/lib/diff2html.js -var require_diff2html = __commonJS({ - "node_modules/diff2html/lib/diff2html.js"(exports) { - "use strict"; - var __assign2 = exports && exports.__assign || function() { - __assign2 = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign2.apply(this, arguments); - }; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding2(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - var __importDefault2 = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.html = exports.parse = exports.defaultDiff2HtmlConfig = void 0; - var DiffParser = __importStar2(require_diff_parser()); - var fileListPrinter = __importStar2(require_file_list_renderer()); - var line_by_line_renderer_1 = __importStar2(require_line_by_line_renderer()); - var side_by_side_renderer_1 = __importStar2(require_side_by_side_renderer()); - var types_1 = require_types(); - var hoganjs_utils_1 = __importDefault2(require_hoganjs_utils()); - exports.defaultDiff2HtmlConfig = __assign2(__assign2(__assign2({}, line_by_line_renderer_1.defaultLineByLineRendererConfig), side_by_side_renderer_1.defaultSideBySideRendererConfig), { outputFormat: types_1.OutputFormatType.LINE_BY_LINE, drawFileList: true }); - function parse(diffInput, configuration) { - if (configuration === void 0) { - configuration = {}; - } - return DiffParser.parse(diffInput, __assign2(__assign2({}, exports.defaultDiff2HtmlConfig), configuration)); - } - exports.parse = parse; - function html2(diffInput, configuration) { - if (configuration === void 0) { - configuration = {}; - } - var config = __assign2(__assign2({}, exports.defaultDiff2HtmlConfig), configuration); - var diffJson = typeof diffInput === "string" ? DiffParser.parse(diffInput, config) : diffInput; - var hoganUtils = new hoganjs_utils_1.default(config); - var fileList = config.drawFileList ? fileListPrinter.render(diffJson, hoganUtils) : ""; - var diffOutput = config.outputFormat === "side-by-side" ? new side_by_side_renderer_1.default(hoganUtils, config).render(diffJson) : new line_by_line_renderer_1.default(hoganUtils, config).render(diffJson); - return fileList + diffOutput; - } - exports.html = html2; - } -}); - -// node_modules/feather-icons/dist/feather.js -var require_feather = __commonJS({ - "node_modules/feather-icons/dist/feather.js"(exports, module2) { - (function webpackUniversalModuleDefinition(root, factory) { - if (typeof exports === "object" && typeof module2 === "object") - module2.exports = factory(); - else if (typeof define === "function" && define.amd) - define([], factory); - else if (typeof exports === "object") - exports["feather"] = factory(); - else - root["feather"] = factory(); - })(typeof self !== "undefined" ? self : exports, function() { - return function(modules) { - var installedModules = {}; - function __webpack_require__(moduleId) { - if (installedModules[moduleId]) { - return installedModules[moduleId].exports; - } - var module3 = installedModules[moduleId] = { - i: moduleId, - l: false, - exports: {} - }; - modules[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__); - module3.l = true; - return module3.exports; - } - __webpack_require__.m = modules; - __webpack_require__.c = installedModules; - __webpack_require__.d = function(exports2, name, getter) { - if (!__webpack_require__.o(exports2, name)) { - Object.defineProperty(exports2, name, { - configurable: false, - enumerable: true, - get: getter - }); - } - }; - __webpack_require__.r = function(exports2) { - Object.defineProperty(exports2, "__esModule", { value: true }); - }; - __webpack_require__.n = function(module3) { - var getter = module3 && module3.__esModule ? function getDefault() { - return module3["default"]; - } : function getModuleExports() { - return module3; - }; - __webpack_require__.d(getter, "a", getter); - return getter; - }; - __webpack_require__.o = function(object, property) { - return Object.prototype.hasOwnProperty.call(object, property); - }; - __webpack_require__.p = ""; - return __webpack_require__(__webpack_require__.s = 0); - }({ - "./dist/icons.json": function(module3) { - module3.exports = { "activity": '', "airplay": '', "alert-circle": '', "alert-octagon": '', "alert-triangle": '', "align-center": '', "align-justify": '', "align-left": '', "align-right": '', "anchor": '', "aperture": '', "archive": '', "arrow-down-circle": '', "arrow-down-left": '', "arrow-down-right": '', "arrow-down": '', "arrow-left-circle": '', "arrow-left": '', "arrow-right-circle": '', "arrow-right": '', "arrow-up-circle": '', "arrow-up-left": '', "arrow-up-right": '', "arrow-up": '', "at-sign": '', "award": '', "bar-chart-2": '', "bar-chart": '', "battery-charging": '', "battery": '', "bell-off": '', "bell": '', "bluetooth": '', "bold": '', "book-open": '', "book": '', "bookmark": '', "box": '', "briefcase": '', "calendar": '', "camera-off": '', "camera": '', "cast": '', "check-circle": '', "check-square": '', "check": '', "chevron-down": '', "chevron-left": '', "chevron-right": '', "chevron-up": '', "chevrons-down": '', "chevrons-left": '', "chevrons-right": '', "chevrons-up": '', "chrome": '', "circle": '', "clipboard": '', "clock": '', "cloud-drizzle": '', "cloud-lightning": '', "cloud-off": '', "cloud-rain": '', "cloud-snow": '', "cloud": '', "code": '', "codepen": '', "codesandbox": '', "coffee": '', "columns": '', "command": '', "compass": '', "copy": '', "corner-down-left": '', "corner-down-right": '', "corner-left-down": '', "corner-left-up": '', "corner-right-down": '', "corner-right-up": '', "corner-up-left": '', "corner-up-right": '', "cpu": '', "credit-card": '', "crop": '', "crosshair": '', "database": '', "delete": '', "disc": '', "divide-circle": '', "divide-square": '', "divide": '', "dollar-sign": '', "download-cloud": '', "download": '', "dribbble": '', "droplet": '', "edit-2": '', "edit-3": '', "edit": '', "external-link": '', "eye-off": '', "eye": '', "facebook": '', "fast-forward": '', "feather": '', "figma": '', "file-minus": '', "file-plus": '', "file-text": '', "file": '', "film": '', "filter": '', "flag": '', "folder-minus": '', "folder-plus": '', "folder": '', "framer": '', "frown": '', "gift": '', "git-branch": '', "git-commit": '', "git-merge": '', "git-pull-request": '', "github": '', "gitlab": '', "globe": '', "grid": '', "hard-drive": '', "hash": '', "headphones": '', "heart": '', "help-circle": '', "hexagon": '', "home": '', "image": '', "inbox": '', "info": '', "instagram": '', "italic": '', "key": '', "layers": '', "layout": '', "life-buoy": '', "link-2": '', "link": '', "linkedin": '', "list": '', "loader": '', "lock": '', "log-in": '', "log-out": '', "mail": '', "map-pin": '', "map": '', "maximize-2": '', "maximize": '', "meh": '', "menu": '', "message-circle": '', "message-square": '', "mic-off": '', "mic": '', "minimize-2": '', "minimize": '', "minus-circle": '', "minus-square": '', "minus": '', "monitor": '', "moon": '', "more-horizontal": '', "more-vertical": '', "mouse-pointer": '', "move": '', "music": '', "navigation-2": '', "navigation": '', "octagon": '', "package": '', "paperclip": '', "pause-circle": '', "pause": '', "pen-tool": '', "percent": '', "phone-call": '', "phone-forwarded": '', "phone-incoming": '', "phone-missed": '', "phone-off": '', "phone-outgoing": '', "phone": '', "pie-chart": '', "play-circle": '', "play": '', "plus-circle": '', "plus-square": '', "plus": '', "pocket": '', "power": '', "printer": '', "radio": '', "refresh-ccw": '', "refresh-cw": '', "repeat": '', "rewind": '', "rotate-ccw": '', "rotate-cw": '', "rss": '', "save": '', "scissors": '', "search": '', "send": '', "server": '', "settings": '', "share-2": '', "share": '', "shield-off": '', "shield": '', "shopping-bag": '', "shopping-cart": '', "shuffle": '', "sidebar": '', "skip-back": '', "skip-forward": '', "slack": '', "slash": '', "sliders": '', "smartphone": '', "smile": '', "speaker": '', "square": '', "star": '', "stop-circle": '', "sun": '', "sunrise": '', "sunset": '', "tablet": '', "tag": '', "target": '', "terminal": '', "thermometer": '', "thumbs-down": '', "thumbs-up": '', "toggle-left": '', "toggle-right": '', "tool": '', "trash-2": '', "trash": '', "trello": '', "trending-down": '', "trending-up": '', "triangle": '', "truck": '', "tv": '', "twitch": '', "twitter": '', "type": '', "umbrella": '', "underline": '', "unlock": '', "upload-cloud": '', "upload": '', "user-check": '', "user-minus": '', "user-plus": '', "user-x": '', "user": '', "users": '', "video-off": '', "video": '', "voicemail": '', "volume-1": '', "volume-2": '', "volume-x": '', "volume": '', "watch": '', "wifi-off": '', "wifi": '', "wind": '', "x-circle": '', "x-octagon": '', "x-square": '', "x": '', "youtube": '', "zap-off": '', "zap": '', "zoom-in": '', "zoom-out": '' }; - }, - "./node_modules/classnames/dedupe.js": function(module3, exports2, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - (function() { - "use strict"; - var classNames = function() { - function StorageObject() { - } - StorageObject.prototype = Object.create(null); - function _parseArray(resultSet, array) { - var length = array.length; - for (var i = 0; i < length; ++i) { - _parse(resultSet, array[i]); - } - } - var hasOwn = {}.hasOwnProperty; - function _parseNumber(resultSet, num) { - resultSet[num] = true; - } - function _parseObject(resultSet, object) { - for (var k in object) { - if (hasOwn.call(object, k)) { - resultSet[k] = !!object[k]; - } - } - } - var SPACE = /\s+/; - function _parseString(resultSet, str) { - var array = str.split(SPACE); - var length = array.length; - for (var i = 0; i < length; ++i) { - resultSet[array[i]] = true; - } - } - function _parse(resultSet, arg) { - if (!arg) - return; - var argType = typeof arg; - if (argType === "string") { - _parseString(resultSet, arg); - } else if (Array.isArray(arg)) { - _parseArray(resultSet, arg); - } else if (argType === "object") { - _parseObject(resultSet, arg); - } else if (argType === "number") { - _parseNumber(resultSet, arg); - } - } - function _classNames() { - var len = arguments.length; - var args = Array(len); - for (var i = 0; i < len; i++) { - args[i] = arguments[i]; - } - var classSet = new StorageObject(); - _parseArray(classSet, args); - var list = []; - for (var k in classSet) { - if (classSet[k]) { - list.push(k); - } - } - return list.join(" "); - } - return _classNames; - }(); - if (typeof module3 !== "undefined" && module3.exports) { - module3.exports = classNames; - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() { - return classNames; - }.apply(exports2, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== void 0 && (module3.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - } - })(); - }, - "./node_modules/core-js/es/array/from.js": function(module3, exports2, __webpack_require__) { - __webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"); - __webpack_require__("./node_modules/core-js/modules/es.array.from.js"); - var path3 = __webpack_require__("./node_modules/core-js/internals/path.js"); - module3.exports = path3.Array.from; - }, - "./node_modules/core-js/internals/a-function.js": function(module3, exports2) { - module3.exports = function(it) { - if (typeof it != "function") { - throw TypeError(String(it) + " is not a function"); - } - return it; - }; - }, - "./node_modules/core-js/internals/an-object.js": function(module3, exports2, __webpack_require__) { - var isObject = __webpack_require__("./node_modules/core-js/internals/is-object.js"); - module3.exports = function(it) { - if (!isObject(it)) { - throw TypeError(String(it) + " is not an object"); - } - return it; - }; - }, - "./node_modules/core-js/internals/array-from.js": function(module3, exports2, __webpack_require__) { - "use strict"; - var bind = __webpack_require__("./node_modules/core-js/internals/bind-context.js"); - var toObject = __webpack_require__("./node_modules/core-js/internals/to-object.js"); - var callWithSafeIterationClosing = __webpack_require__("./node_modules/core-js/internals/call-with-safe-iteration-closing.js"); - var isArrayIteratorMethod = __webpack_require__("./node_modules/core-js/internals/is-array-iterator-method.js"); - var toLength = __webpack_require__("./node_modules/core-js/internals/to-length.js"); - var createProperty = __webpack_require__("./node_modules/core-js/internals/create-property.js"); - var getIteratorMethod = __webpack_require__("./node_modules/core-js/internals/get-iterator-method.js"); - module3.exports = function from(arrayLike) { - var O = toObject(arrayLike); - var C = typeof this == "function" ? this : Array; - var argumentsLength = arguments.length; - var mapfn = argumentsLength > 1 ? arguments[1] : void 0; - var mapping = mapfn !== void 0; - var index = 0; - var iteratorMethod = getIteratorMethod(O); - var length, result, step, iterator; - if (mapping) - mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : void 0, 2); - if (iteratorMethod != void 0 && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { - iterator = iteratorMethod.call(O); - result = new C(); - for (; !(step = iterator.next()).done; index++) { - createProperty(result, index, mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value); - } - } else { - length = toLength(O.length); - result = new C(length); - for (; length > index; index++) { - createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); - } - } - result.length = index; - return result; - }; - }, - "./node_modules/core-js/internals/array-includes.js": function(module3, exports2, __webpack_require__) { - var toIndexedObject = __webpack_require__("./node_modules/core-js/internals/to-indexed-object.js"); - var toLength = __webpack_require__("./node_modules/core-js/internals/to-length.js"); - var toAbsoluteIndex = __webpack_require__("./node_modules/core-js/internals/to-absolute-index.js"); - module3.exports = function(IS_INCLUDES) { - return function($this, el, fromIndex) { - var O = toIndexedObject($this); - var length = toLength(O.length); - var index = toAbsoluteIndex(fromIndex, length); - var value; - if (IS_INCLUDES && el != el) - while (length > index) { - value = O[index++]; - if (value != value) - return true; - } - else - for (; length > index; index++) - if (IS_INCLUDES || index in O) { - if (O[index] === el) - return IS_INCLUDES || index || 0; - } - return !IS_INCLUDES && -1; - }; - }; - }, - "./node_modules/core-js/internals/bind-context.js": function(module3, exports2, __webpack_require__) { - var aFunction = __webpack_require__("./node_modules/core-js/internals/a-function.js"); - module3.exports = function(fn, that, length) { - aFunction(fn); - if (that === void 0) - return fn; - switch (length) { - case 0: - return function() { - return fn.call(that); - }; - case 1: - return function(a) { - return fn.call(that, a); - }; - case 2: - return function(a, b) { - return fn.call(that, a, b); - }; - case 3: - return function(a, b, c) { - return fn.call(that, a, b, c); - }; - } - return function() { - return fn.apply(that, arguments); - }; - }; - }, - "./node_modules/core-js/internals/call-with-safe-iteration-closing.js": function(module3, exports2, __webpack_require__) { - var anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js"); - module3.exports = function(iterator, fn, value, ENTRIES) { - try { - return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); - } catch (error) { - var returnMethod = iterator["return"]; - if (returnMethod !== void 0) - anObject(returnMethod.call(iterator)); - throw error; - } - }; - }, - "./node_modules/core-js/internals/check-correctness-of-iteration.js": function(module3, exports2, __webpack_require__) { - var wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"); - var ITERATOR = wellKnownSymbol("iterator"); - var SAFE_CLOSING = false; - try { - var called = 0; - var iteratorWithReturn = { - next: function() { - return { done: !!called++ }; - }, - "return": function() { - SAFE_CLOSING = true; - } - }; - iteratorWithReturn[ITERATOR] = function() { - return this; - }; - Array.from(iteratorWithReturn, function() { - throw 2; - }); - } catch (error) { - } - module3.exports = function(exec, SKIP_CLOSING) { - if (!SKIP_CLOSING && !SAFE_CLOSING) - return false; - var ITERATION_SUPPORT = false; - try { - var object = {}; - object[ITERATOR] = function() { - return { - next: function() { - return { done: ITERATION_SUPPORT = true }; - } - }; - }; - exec(object); - } catch (error) { - } - return ITERATION_SUPPORT; - }; - }, - "./node_modules/core-js/internals/classof-raw.js": function(module3, exports2) { - var toString = {}.toString; - module3.exports = function(it) { - return toString.call(it).slice(8, -1); - }; - }, - "./node_modules/core-js/internals/classof.js": function(module3, exports2, __webpack_require__) { - var classofRaw = __webpack_require__("./node_modules/core-js/internals/classof-raw.js"); - var wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"); - var TO_STRING_TAG = wellKnownSymbol("toStringTag"); - var CORRECT_ARGUMENTS = classofRaw(function() { - return arguments; - }()) == "Arguments"; - var tryGet = function(it, key2) { - try { - return it[key2]; - } catch (error) { - } - }; - module3.exports = function(it) { - var O, tag, result; - return it === void 0 ? "Undefined" : it === null ? "Null" : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) == "Object" && typeof O.callee == "function" ? "Arguments" : result; - }; - }, - "./node_modules/core-js/internals/copy-constructor-properties.js": function(module3, exports2, __webpack_require__) { - var has = __webpack_require__("./node_modules/core-js/internals/has.js"); - var ownKeys = __webpack_require__("./node_modules/core-js/internals/own-keys.js"); - var getOwnPropertyDescriptorModule = __webpack_require__("./node_modules/core-js/internals/object-get-own-property-descriptor.js"); - var definePropertyModule = __webpack_require__("./node_modules/core-js/internals/object-define-property.js"); - module3.exports = function(target, source) { - var keys = ownKeys(source); - var defineProperty = definePropertyModule.f; - var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; - for (var i = 0; i < keys.length; i++) { - var key2 = keys[i]; - if (!has(target, key2)) - defineProperty(target, key2, getOwnPropertyDescriptor(source, key2)); - } - }; - }, - "./node_modules/core-js/internals/correct-prototype-getter.js": function(module3, exports2, __webpack_require__) { - var fails = __webpack_require__("./node_modules/core-js/internals/fails.js"); - module3.exports = !fails(function() { - function F() { - } - F.prototype.constructor = null; - return Object.getPrototypeOf(new F()) !== F.prototype; - }); - }, - "./node_modules/core-js/internals/create-iterator-constructor.js": function(module3, exports2, __webpack_require__) { - "use strict"; - var IteratorPrototype = __webpack_require__("./node_modules/core-js/internals/iterators-core.js").IteratorPrototype; - var create = __webpack_require__("./node_modules/core-js/internals/object-create.js"); - var createPropertyDescriptor = __webpack_require__("./node_modules/core-js/internals/create-property-descriptor.js"); - var setToStringTag = __webpack_require__("./node_modules/core-js/internals/set-to-string-tag.js"); - var Iterators = __webpack_require__("./node_modules/core-js/internals/iterators.js"); - var returnThis = function() { - return this; - }; - module3.exports = function(IteratorConstructor, NAME, next) { - var TO_STRING_TAG = NAME + " Iterator"; - IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) }); - setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); - Iterators[TO_STRING_TAG] = returnThis; - return IteratorConstructor; - }; - }, - "./node_modules/core-js/internals/create-property-descriptor.js": function(module3, exports2) { - module3.exports = function(bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value - }; - }; - }, - "./node_modules/core-js/internals/create-property.js": function(module3, exports2, __webpack_require__) { - "use strict"; - var toPrimitive = __webpack_require__("./node_modules/core-js/internals/to-primitive.js"); - var definePropertyModule = __webpack_require__("./node_modules/core-js/internals/object-define-property.js"); - var createPropertyDescriptor = __webpack_require__("./node_modules/core-js/internals/create-property-descriptor.js"); - module3.exports = function(object, key2, value) { - var propertyKey = toPrimitive(key2); - if (propertyKey in object) - definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); - else - object[propertyKey] = value; - }; - }, - "./node_modules/core-js/internals/define-iterator.js": function(module3, exports2, __webpack_require__) { - "use strict"; - var $ = __webpack_require__("./node_modules/core-js/internals/export.js"); - var createIteratorConstructor = __webpack_require__("./node_modules/core-js/internals/create-iterator-constructor.js"); - var getPrototypeOf = __webpack_require__("./node_modules/core-js/internals/object-get-prototype-of.js"); - var setPrototypeOf = __webpack_require__("./node_modules/core-js/internals/object-set-prototype-of.js"); - var setToStringTag = __webpack_require__("./node_modules/core-js/internals/set-to-string-tag.js"); - var hide = __webpack_require__("./node_modules/core-js/internals/hide.js"); - var redefine = __webpack_require__("./node_modules/core-js/internals/redefine.js"); - var wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"); - var IS_PURE = __webpack_require__("./node_modules/core-js/internals/is-pure.js"); - var Iterators = __webpack_require__("./node_modules/core-js/internals/iterators.js"); - var IteratorsCore = __webpack_require__("./node_modules/core-js/internals/iterators-core.js"); - var IteratorPrototype = IteratorsCore.IteratorPrototype; - var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; - var ITERATOR = wellKnownSymbol("iterator"); - var KEYS = "keys"; - var VALUES = "values"; - var ENTRIES = "entries"; - var returnThis = function() { - return this; - }; - module3.exports = function(Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { - createIteratorConstructor(IteratorConstructor, NAME, next); - var getIterationMethod = function(KIND) { - if (KIND === DEFAULT && defaultIterator) - return defaultIterator; - if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) - return IterablePrototype[KIND]; - switch (KIND) { - case KEYS: - return function keys() { - return new IteratorConstructor(this, KIND); - }; - case VALUES: - return function values() { - return new IteratorConstructor(this, KIND); - }; - case ENTRIES: - return function entries() { - return new IteratorConstructor(this, KIND); - }; - } - return function() { - return new IteratorConstructor(this); - }; - }; - var TO_STRING_TAG = NAME + " Iterator"; - var INCORRECT_VALUES_NAME = false; - var IterablePrototype = Iterable.prototype; - var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype["@@iterator"] || DEFAULT && IterablePrototype[DEFAULT]; - var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); - var anyNativeIterator = NAME == "Array" ? IterablePrototype.entries || nativeIterator : nativeIterator; - var CurrentIteratorPrototype, methods, KEY; - if (anyNativeIterator) { - CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); - if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { - if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { - if (setPrototypeOf) { - setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); - } else if (typeof CurrentIteratorPrototype[ITERATOR] != "function") { - hide(CurrentIteratorPrototype, ITERATOR, returnThis); - } - } - setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); - if (IS_PURE) - Iterators[TO_STRING_TAG] = returnThis; - } - } - if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { - INCORRECT_VALUES_NAME = true; - defaultIterator = function values() { - return nativeIterator.call(this); - }; - } - if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { - hide(IterablePrototype, ITERATOR, defaultIterator); - } - Iterators[NAME] = defaultIterator; - if (DEFAULT) { - methods = { - values: getIterationMethod(VALUES), - keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), - entries: getIterationMethod(ENTRIES) - }; - if (FORCED) - for (KEY in methods) { - if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { - redefine(IterablePrototype, KEY, methods[KEY]); - } - } - else - $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); - } - return methods; - }; - }, - "./node_modules/core-js/internals/descriptors.js": function(module3, exports2, __webpack_require__) { - var fails = __webpack_require__("./node_modules/core-js/internals/fails.js"); - module3.exports = !fails(function() { - return Object.defineProperty({}, "a", { get: function() { - return 7; - } }).a != 7; - }); - }, - "./node_modules/core-js/internals/document-create-element.js": function(module3, exports2, __webpack_require__) { - var global2 = __webpack_require__("./node_modules/core-js/internals/global.js"); - var isObject = __webpack_require__("./node_modules/core-js/internals/is-object.js"); - var document2 = global2.document; - var exist = isObject(document2) && isObject(document2.createElement); - module3.exports = function(it) { - return exist ? document2.createElement(it) : {}; - }; - }, - "./node_modules/core-js/internals/enum-bug-keys.js": function(module3, exports2) { - module3.exports = [ - "constructor", - "hasOwnProperty", - "isPrototypeOf", - "propertyIsEnumerable", - "toLocaleString", - "toString", - "valueOf" - ]; - }, - "./node_modules/core-js/internals/export.js": function(module3, exports2, __webpack_require__) { - var global2 = __webpack_require__("./node_modules/core-js/internals/global.js"); - var getOwnPropertyDescriptor = __webpack_require__("./node_modules/core-js/internals/object-get-own-property-descriptor.js").f; - var hide = __webpack_require__("./node_modules/core-js/internals/hide.js"); - var redefine = __webpack_require__("./node_modules/core-js/internals/redefine.js"); - var setGlobal = __webpack_require__("./node_modules/core-js/internals/set-global.js"); - var copyConstructorProperties = __webpack_require__("./node_modules/core-js/internals/copy-constructor-properties.js"); - var isForced = __webpack_require__("./node_modules/core-js/internals/is-forced.js"); - module3.exports = function(options, source) { - var TARGET = options.target; - var GLOBAL = options.global; - var STATIC = options.stat; - var FORCED, target, key2, targetProperty, sourceProperty, descriptor; - if (GLOBAL) { - target = global2; - } else if (STATIC) { - target = global2[TARGET] || setGlobal(TARGET, {}); - } else { - target = (global2[TARGET] || {}).prototype; - } - if (target) - for (key2 in source) { - sourceProperty = source[key2]; - if (options.noTargetGet) { - descriptor = getOwnPropertyDescriptor(target, key2); - targetProperty = descriptor && descriptor.value; - } else - targetProperty = target[key2]; - FORCED = isForced(GLOBAL ? key2 : TARGET + (STATIC ? "." : "#") + key2, options.forced); - if (!FORCED && targetProperty !== void 0) { - if (typeof sourceProperty === typeof targetProperty) - continue; - copyConstructorProperties(sourceProperty, targetProperty); - } - if (options.sham || targetProperty && targetProperty.sham) { - hide(sourceProperty, "sham", true); - } - redefine(target, key2, sourceProperty, options); - } - }; - }, - "./node_modules/core-js/internals/fails.js": function(module3, exports2) { - module3.exports = function(exec) { - try { - return !!exec(); - } catch (error) { - return true; - } - }; - }, - "./node_modules/core-js/internals/function-to-string.js": function(module3, exports2, __webpack_require__) { - var shared = __webpack_require__("./node_modules/core-js/internals/shared.js"); - module3.exports = shared("native-function-to-string", Function.toString); - }, - "./node_modules/core-js/internals/get-iterator-method.js": function(module3, exports2, __webpack_require__) { - var classof = __webpack_require__("./node_modules/core-js/internals/classof.js"); - var Iterators = __webpack_require__("./node_modules/core-js/internals/iterators.js"); - var wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"); - var ITERATOR = wellKnownSymbol("iterator"); - module3.exports = function(it) { - if (it != void 0) - return it[ITERATOR] || it["@@iterator"] || Iterators[classof(it)]; - }; - }, - "./node_modules/core-js/internals/global.js": function(module3, exports2, __webpack_require__) { - (function(global2) { - var O = "object"; - var check = function(it) { - return it && it.Math == Math && it; - }; - module3.exports = check(typeof globalThis == O && globalThis) || check(typeof window == O && window) || check(typeof self == O && self) || check(typeof global2 == O && global2) || Function("return this")(); - }).call(this, __webpack_require__("./node_modules/webpack/buildin/global.js")); - }, - "./node_modules/core-js/internals/has.js": function(module3, exports2) { - var hasOwnProperty = {}.hasOwnProperty; - module3.exports = function(it, key2) { - return hasOwnProperty.call(it, key2); - }; - }, - "./node_modules/core-js/internals/hidden-keys.js": function(module3, exports2) { - module3.exports = {}; - }, - "./node_modules/core-js/internals/hide.js": function(module3, exports2, __webpack_require__) { - var DESCRIPTORS = __webpack_require__("./node_modules/core-js/internals/descriptors.js"); - var definePropertyModule = __webpack_require__("./node_modules/core-js/internals/object-define-property.js"); - var createPropertyDescriptor = __webpack_require__("./node_modules/core-js/internals/create-property-descriptor.js"); - module3.exports = DESCRIPTORS ? function(object, key2, value) { - return definePropertyModule.f(object, key2, createPropertyDescriptor(1, value)); - } : function(object, key2, value) { - object[key2] = value; - return object; - }; - }, - "./node_modules/core-js/internals/html.js": function(module3, exports2, __webpack_require__) { - var global2 = __webpack_require__("./node_modules/core-js/internals/global.js"); - var document2 = global2.document; - module3.exports = document2 && document2.documentElement; - }, - "./node_modules/core-js/internals/ie8-dom-define.js": function(module3, exports2, __webpack_require__) { - var DESCRIPTORS = __webpack_require__("./node_modules/core-js/internals/descriptors.js"); - var fails = __webpack_require__("./node_modules/core-js/internals/fails.js"); - var createElement = __webpack_require__("./node_modules/core-js/internals/document-create-element.js"); - module3.exports = !DESCRIPTORS && !fails(function() { - return Object.defineProperty(createElement("div"), "a", { - get: function() { - return 7; - } - }).a != 7; - }); - }, - "./node_modules/core-js/internals/indexed-object.js": function(module3, exports2, __webpack_require__) { - var fails = __webpack_require__("./node_modules/core-js/internals/fails.js"); - var classof = __webpack_require__("./node_modules/core-js/internals/classof-raw.js"); - var split = "".split; - module3.exports = fails(function() { - return !Object("z").propertyIsEnumerable(0); - }) ? function(it) { - return classof(it) == "String" ? split.call(it, "") : Object(it); - } : Object; - }, - "./node_modules/core-js/internals/internal-state.js": function(module3, exports2, __webpack_require__) { - var NATIVE_WEAK_MAP = __webpack_require__("./node_modules/core-js/internals/native-weak-map.js"); - var global2 = __webpack_require__("./node_modules/core-js/internals/global.js"); - var isObject = __webpack_require__("./node_modules/core-js/internals/is-object.js"); - var hide = __webpack_require__("./node_modules/core-js/internals/hide.js"); - var objectHas = __webpack_require__("./node_modules/core-js/internals/has.js"); - var sharedKey = __webpack_require__("./node_modules/core-js/internals/shared-key.js"); - var hiddenKeys = __webpack_require__("./node_modules/core-js/internals/hidden-keys.js"); - var WeakMap = global2.WeakMap; - var set, get, has; - var enforce = function(it) { - return has(it) ? get(it) : set(it, {}); - }; - var getterFor = function(TYPE) { - return function(it) { - var state; - if (!isObject(it) || (state = get(it)).type !== TYPE) { - throw TypeError("Incompatible receiver, " + TYPE + " required"); - } - return state; - }; - }; - if (NATIVE_WEAK_MAP) { - var store = new WeakMap(); - var wmget = store.get; - var wmhas = store.has; - var wmset = store.set; - set = function(it, metadata) { - wmset.call(store, it, metadata); - return metadata; - }; - get = function(it) { - return wmget.call(store, it) || {}; - }; - has = function(it) { - return wmhas.call(store, it); - }; - } else { - var STATE = sharedKey("state"); - hiddenKeys[STATE] = true; - set = function(it, metadata) { - hide(it, STATE, metadata); - return metadata; - }; - get = function(it) { - return objectHas(it, STATE) ? it[STATE] : {}; - }; - has = function(it) { - return objectHas(it, STATE); - }; - } - module3.exports = { - set, - get, - has, - enforce, - getterFor - }; - }, - "./node_modules/core-js/internals/is-array-iterator-method.js": function(module3, exports2, __webpack_require__) { - var wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"); - var Iterators = __webpack_require__("./node_modules/core-js/internals/iterators.js"); - var ITERATOR = wellKnownSymbol("iterator"); - var ArrayPrototype = Array.prototype; - module3.exports = function(it) { - return it !== void 0 && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); - }; - }, - "./node_modules/core-js/internals/is-forced.js": function(module3, exports2, __webpack_require__) { - var fails = __webpack_require__("./node_modules/core-js/internals/fails.js"); - var replacement = /#|\.prototype\./; - var isForced = function(feature, detection) { - var value = data[normalize2(feature)]; - return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == "function" ? fails(detection) : !!detection; - }; - var normalize2 = isForced.normalize = function(string) { - return String(string).replace(replacement, ".").toLowerCase(); - }; - var data = isForced.data = {}; - var NATIVE = isForced.NATIVE = "N"; - var POLYFILL = isForced.POLYFILL = "P"; - module3.exports = isForced; - }, - "./node_modules/core-js/internals/is-object.js": function(module3, exports2) { - module3.exports = function(it) { - return typeof it === "object" ? it !== null : typeof it === "function"; - }; - }, - "./node_modules/core-js/internals/is-pure.js": function(module3, exports2) { - module3.exports = false; - }, - "./node_modules/core-js/internals/iterators-core.js": function(module3, exports2, __webpack_require__) { - "use strict"; - var getPrototypeOf = __webpack_require__("./node_modules/core-js/internals/object-get-prototype-of.js"); - var hide = __webpack_require__("./node_modules/core-js/internals/hide.js"); - var has = __webpack_require__("./node_modules/core-js/internals/has.js"); - var wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"); - var IS_PURE = __webpack_require__("./node_modules/core-js/internals/is-pure.js"); - var ITERATOR = wellKnownSymbol("iterator"); - var BUGGY_SAFARI_ITERATORS = false; - var returnThis = function() { - return this; - }; - var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; - if ([].keys) { - arrayIterator = [].keys(); - if (!("next" in arrayIterator)) - BUGGY_SAFARI_ITERATORS = true; - else { - PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); - if (PrototypeOfArrayIteratorPrototype !== Object.prototype) - IteratorPrototype = PrototypeOfArrayIteratorPrototype; - } - } - if (IteratorPrototype == void 0) - IteratorPrototype = {}; - if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) - hide(IteratorPrototype, ITERATOR, returnThis); - module3.exports = { - IteratorPrototype, - BUGGY_SAFARI_ITERATORS - }; - }, - "./node_modules/core-js/internals/iterators.js": function(module3, exports2) { - module3.exports = {}; - }, - "./node_modules/core-js/internals/native-symbol.js": function(module3, exports2, __webpack_require__) { - var fails = __webpack_require__("./node_modules/core-js/internals/fails.js"); - module3.exports = !!Object.getOwnPropertySymbols && !fails(function() { - return !String(Symbol()); - }); - }, - "./node_modules/core-js/internals/native-weak-map.js": function(module3, exports2, __webpack_require__) { - var global2 = __webpack_require__("./node_modules/core-js/internals/global.js"); - var nativeFunctionToString = __webpack_require__("./node_modules/core-js/internals/function-to-string.js"); - var WeakMap = global2.WeakMap; - module3.exports = typeof WeakMap === "function" && /native code/.test(nativeFunctionToString.call(WeakMap)); - }, - "./node_modules/core-js/internals/object-create.js": function(module3, exports2, __webpack_require__) { - var anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js"); - var defineProperties = __webpack_require__("./node_modules/core-js/internals/object-define-properties.js"); - var enumBugKeys = __webpack_require__("./node_modules/core-js/internals/enum-bug-keys.js"); - var hiddenKeys = __webpack_require__("./node_modules/core-js/internals/hidden-keys.js"); - var html2 = __webpack_require__("./node_modules/core-js/internals/html.js"); - var documentCreateElement = __webpack_require__("./node_modules/core-js/internals/document-create-element.js"); - var sharedKey = __webpack_require__("./node_modules/core-js/internals/shared-key.js"); - var IE_PROTO = sharedKey("IE_PROTO"); - var PROTOTYPE = "prototype"; - var Empty = function() { - }; - var createDict = function() { - var iframe = documentCreateElement("iframe"); - var length = enumBugKeys.length; - var lt = "<"; - var script = "script"; - var gt = ">"; - var js = "java" + script + ":"; - var iframeDocument; - iframe.style.display = "none"; - html2.appendChild(iframe); - iframe.src = String(js); - iframeDocument = iframe.contentWindow.document; - iframeDocument.open(); - iframeDocument.write(lt + script + gt + "document.F=Object" + lt + "/" + script + gt); - iframeDocument.close(); - createDict = iframeDocument.F; - while (length--) - delete createDict[PROTOTYPE][enumBugKeys[length]]; - return createDict(); - }; - module3.exports = Object.create || function create(O, Properties) { - var result; - if (O !== null) { - Empty[PROTOTYPE] = anObject(O); - result = new Empty(); - Empty[PROTOTYPE] = null; - result[IE_PROTO] = O; - } else - result = createDict(); - return Properties === void 0 ? result : defineProperties(result, Properties); - }; - hiddenKeys[IE_PROTO] = true; - }, - "./node_modules/core-js/internals/object-define-properties.js": function(module3, exports2, __webpack_require__) { - var DESCRIPTORS = __webpack_require__("./node_modules/core-js/internals/descriptors.js"); - var definePropertyModule = __webpack_require__("./node_modules/core-js/internals/object-define-property.js"); - var anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js"); - var objectKeys = __webpack_require__("./node_modules/core-js/internals/object-keys.js"); - module3.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) { - anObject(O); - var keys = objectKeys(Properties); - var length = keys.length; - var i = 0; - var key2; - while (length > i) - definePropertyModule.f(O, key2 = keys[i++], Properties[key2]); - return O; - }; - }, - "./node_modules/core-js/internals/object-define-property.js": function(module3, exports2, __webpack_require__) { - var DESCRIPTORS = __webpack_require__("./node_modules/core-js/internals/descriptors.js"); - var IE8_DOM_DEFINE = __webpack_require__("./node_modules/core-js/internals/ie8-dom-define.js"); - var anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js"); - var toPrimitive = __webpack_require__("./node_modules/core-js/internals/to-primitive.js"); - var nativeDefineProperty = Object.defineProperty; - exports2.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) { - anObject(O); - P = toPrimitive(P, true); - anObject(Attributes); - if (IE8_DOM_DEFINE) - try { - return nativeDefineProperty(O, P, Attributes); - } catch (error) { - } - if ("get" in Attributes || "set" in Attributes) - throw TypeError("Accessors not supported"); - if ("value" in Attributes) - O[P] = Attributes.value; - return O; - }; - }, - "./node_modules/core-js/internals/object-get-own-property-descriptor.js": function(module3, exports2, __webpack_require__) { - var DESCRIPTORS = __webpack_require__("./node_modules/core-js/internals/descriptors.js"); - var propertyIsEnumerableModule = __webpack_require__("./node_modules/core-js/internals/object-property-is-enumerable.js"); - var createPropertyDescriptor = __webpack_require__("./node_modules/core-js/internals/create-property-descriptor.js"); - var toIndexedObject = __webpack_require__("./node_modules/core-js/internals/to-indexed-object.js"); - var toPrimitive = __webpack_require__("./node_modules/core-js/internals/to-primitive.js"); - var has = __webpack_require__("./node_modules/core-js/internals/has.js"); - var IE8_DOM_DEFINE = __webpack_require__("./node_modules/core-js/internals/ie8-dom-define.js"); - var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - exports2.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { - O = toIndexedObject(O); - P = toPrimitive(P, true); - if (IE8_DOM_DEFINE) - try { - return nativeGetOwnPropertyDescriptor(O, P); - } catch (error) { - } - if (has(O, P)) - return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); - }; - }, - "./node_modules/core-js/internals/object-get-own-property-names.js": function(module3, exports2, __webpack_require__) { - var internalObjectKeys = __webpack_require__("./node_modules/core-js/internals/object-keys-internal.js"); - var enumBugKeys = __webpack_require__("./node_modules/core-js/internals/enum-bug-keys.js"); - var hiddenKeys = enumBugKeys.concat("length", "prototype"); - exports2.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return internalObjectKeys(O, hiddenKeys); - }; - }, - "./node_modules/core-js/internals/object-get-own-property-symbols.js": function(module3, exports2) { - exports2.f = Object.getOwnPropertySymbols; - }, - "./node_modules/core-js/internals/object-get-prototype-of.js": function(module3, exports2, __webpack_require__) { - var has = __webpack_require__("./node_modules/core-js/internals/has.js"); - var toObject = __webpack_require__("./node_modules/core-js/internals/to-object.js"); - var sharedKey = __webpack_require__("./node_modules/core-js/internals/shared-key.js"); - var CORRECT_PROTOTYPE_GETTER = __webpack_require__("./node_modules/core-js/internals/correct-prototype-getter.js"); - var IE_PROTO = sharedKey("IE_PROTO"); - var ObjectPrototype = Object.prototype; - module3.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function(O) { - O = toObject(O); - if (has(O, IE_PROTO)) - return O[IE_PROTO]; - if (typeof O.constructor == "function" && O instanceof O.constructor) { - return O.constructor.prototype; - } - return O instanceof Object ? ObjectPrototype : null; - }; - }, - "./node_modules/core-js/internals/object-keys-internal.js": function(module3, exports2, __webpack_require__) { - var has = __webpack_require__("./node_modules/core-js/internals/has.js"); - var toIndexedObject = __webpack_require__("./node_modules/core-js/internals/to-indexed-object.js"); - var arrayIncludes = __webpack_require__("./node_modules/core-js/internals/array-includes.js"); - var hiddenKeys = __webpack_require__("./node_modules/core-js/internals/hidden-keys.js"); - var arrayIndexOf = arrayIncludes(false); - module3.exports = function(object, names) { - var O = toIndexedObject(object); - var i = 0; - var result = []; - var key2; - for (key2 in O) - !has(hiddenKeys, key2) && has(O, key2) && result.push(key2); - while (names.length > i) - if (has(O, key2 = names[i++])) { - ~arrayIndexOf(result, key2) || result.push(key2); - } - return result; - }; - }, - "./node_modules/core-js/internals/object-keys.js": function(module3, exports2, __webpack_require__) { - var internalObjectKeys = __webpack_require__("./node_modules/core-js/internals/object-keys-internal.js"); - var enumBugKeys = __webpack_require__("./node_modules/core-js/internals/enum-bug-keys.js"); - module3.exports = Object.keys || function keys(O) { - return internalObjectKeys(O, enumBugKeys); - }; - }, - "./node_modules/core-js/internals/object-property-is-enumerable.js": function(module3, exports2, __webpack_require__) { - "use strict"; - var nativePropertyIsEnumerable = {}.propertyIsEnumerable; - var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1); - exports2.f = NASHORN_BUG ? function propertyIsEnumerable(V) { - var descriptor = getOwnPropertyDescriptor(this, V); - return !!descriptor && descriptor.enumerable; - } : nativePropertyIsEnumerable; - }, - "./node_modules/core-js/internals/object-set-prototype-of.js": function(module3, exports2, __webpack_require__) { - var validateSetPrototypeOfArguments = __webpack_require__("./node_modules/core-js/internals/validate-set-prototype-of-arguments.js"); - module3.exports = Object.setPrototypeOf || ("__proto__" in {} ? function() { - var correctSetter = false; - var test = {}; - var setter; - try { - setter = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set; - setter.call(test, []); - correctSetter = test instanceof Array; - } catch (error) { - } - return function setPrototypeOf(O, proto) { - validateSetPrototypeOfArguments(O, proto); - if (correctSetter) - setter.call(O, proto); - else - O.__proto__ = proto; - return O; - }; - }() : void 0); - }, - "./node_modules/core-js/internals/own-keys.js": function(module3, exports2, __webpack_require__) { - var global2 = __webpack_require__("./node_modules/core-js/internals/global.js"); - var getOwnPropertyNamesModule = __webpack_require__("./node_modules/core-js/internals/object-get-own-property-names.js"); - var getOwnPropertySymbolsModule = __webpack_require__("./node_modules/core-js/internals/object-get-own-property-symbols.js"); - var anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js"); - var Reflect2 = global2.Reflect; - module3.exports = Reflect2 && Reflect2.ownKeys || function ownKeys(it) { - var keys = getOwnPropertyNamesModule.f(anObject(it)); - var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; - return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; - }; - }, - "./node_modules/core-js/internals/path.js": function(module3, exports2, __webpack_require__) { - module3.exports = __webpack_require__("./node_modules/core-js/internals/global.js"); - }, - "./node_modules/core-js/internals/redefine.js": function(module3, exports2, __webpack_require__) { - var global2 = __webpack_require__("./node_modules/core-js/internals/global.js"); - var shared = __webpack_require__("./node_modules/core-js/internals/shared.js"); - var hide = __webpack_require__("./node_modules/core-js/internals/hide.js"); - var has = __webpack_require__("./node_modules/core-js/internals/has.js"); - var setGlobal = __webpack_require__("./node_modules/core-js/internals/set-global.js"); - var nativeFunctionToString = __webpack_require__("./node_modules/core-js/internals/function-to-string.js"); - var InternalStateModule = __webpack_require__("./node_modules/core-js/internals/internal-state.js"); - var getInternalState = InternalStateModule.get; - var enforceInternalState = InternalStateModule.enforce; - var TEMPLATE = String(nativeFunctionToString).split("toString"); - shared("inspectSource", function(it) { - return nativeFunctionToString.call(it); - }); - (module3.exports = function(O, key2, value, options) { - var unsafe = options ? !!options.unsafe : false; - var simple2 = options ? !!options.enumerable : false; - var noTargetGet = options ? !!options.noTargetGet : false; - if (typeof value == "function") { - if (typeof key2 == "string" && !has(value, "name")) - hide(value, "name", key2); - enforceInternalState(value).source = TEMPLATE.join(typeof key2 == "string" ? key2 : ""); - } - if (O === global2) { - if (simple2) - O[key2] = value; - else - setGlobal(key2, value); - return; - } else if (!unsafe) { - delete O[key2]; - } else if (!noTargetGet && O[key2]) { - simple2 = true; - } - if (simple2) - O[key2] = value; - else - hide(O, key2, value); - })(Function.prototype, "toString", function toString() { - return typeof this == "function" && getInternalState(this).source || nativeFunctionToString.call(this); - }); - }, - "./node_modules/core-js/internals/require-object-coercible.js": function(module3, exports2) { - module3.exports = function(it) { - if (it == void 0) - throw TypeError("Can't call method on " + it); - return it; - }; - }, - "./node_modules/core-js/internals/set-global.js": function(module3, exports2, __webpack_require__) { - var global2 = __webpack_require__("./node_modules/core-js/internals/global.js"); - var hide = __webpack_require__("./node_modules/core-js/internals/hide.js"); - module3.exports = function(key2, value) { - try { - hide(global2, key2, value); - } catch (error) { - global2[key2] = value; - } - return value; - }; - }, - "./node_modules/core-js/internals/set-to-string-tag.js": function(module3, exports2, __webpack_require__) { - var defineProperty = __webpack_require__("./node_modules/core-js/internals/object-define-property.js").f; - var has = __webpack_require__("./node_modules/core-js/internals/has.js"); - var wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"); - var TO_STRING_TAG = wellKnownSymbol("toStringTag"); - module3.exports = function(it, TAG, STATIC) { - if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) { - defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG }); - } - }; - }, - "./node_modules/core-js/internals/shared-key.js": function(module3, exports2, __webpack_require__) { - var shared = __webpack_require__("./node_modules/core-js/internals/shared.js"); - var uid = __webpack_require__("./node_modules/core-js/internals/uid.js"); - var keys = shared("keys"); - module3.exports = function(key2) { - return keys[key2] || (keys[key2] = uid(key2)); - }; - }, - "./node_modules/core-js/internals/shared.js": function(module3, exports2, __webpack_require__) { - var global2 = __webpack_require__("./node_modules/core-js/internals/global.js"); - var setGlobal = __webpack_require__("./node_modules/core-js/internals/set-global.js"); - var IS_PURE = __webpack_require__("./node_modules/core-js/internals/is-pure.js"); - var SHARED = "__core-js_shared__"; - var store = global2[SHARED] || setGlobal(SHARED, {}); - (module3.exports = function(key2, value) { - return store[key2] || (store[key2] = value !== void 0 ? value : {}); - })("versions", []).push({ - version: "3.1.3", - mode: IS_PURE ? "pure" : "global", - copyright: "\xA9 2019 Denis Pushkarev (zloirock.ru)" - }); - }, - "./node_modules/core-js/internals/string-at.js": function(module3, exports2, __webpack_require__) { - var toInteger = __webpack_require__("./node_modules/core-js/internals/to-integer.js"); - var requireObjectCoercible = __webpack_require__("./node_modules/core-js/internals/require-object-coercible.js"); - module3.exports = function(that, pos, CONVERT_TO_STRING) { - var S = String(requireObjectCoercible(that)); - var position = toInteger(pos); - var size = S.length; - var first, second; - if (position < 0 || position >= size) - return CONVERT_TO_STRING ? "" : void 0; - first = S.charCodeAt(position); - return first < 55296 || first > 56319 || position + 1 === size || (second = S.charCodeAt(position + 1)) < 56320 || second > 57343 ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 55296 << 10) + (second - 56320) + 65536; - }; - }, - "./node_modules/core-js/internals/to-absolute-index.js": function(module3, exports2, __webpack_require__) { - var toInteger = __webpack_require__("./node_modules/core-js/internals/to-integer.js"); - var max = Math.max; - var min = Math.min; - module3.exports = function(index, length) { - var integer = toInteger(index); - return integer < 0 ? max(integer + length, 0) : min(integer, length); - }; - }, - "./node_modules/core-js/internals/to-indexed-object.js": function(module3, exports2, __webpack_require__) { - var IndexedObject = __webpack_require__("./node_modules/core-js/internals/indexed-object.js"); - var requireObjectCoercible = __webpack_require__("./node_modules/core-js/internals/require-object-coercible.js"); - module3.exports = function(it) { - return IndexedObject(requireObjectCoercible(it)); - }; - }, - "./node_modules/core-js/internals/to-integer.js": function(module3, exports2) { - var ceil = Math.ceil; - var floor = Math.floor; - module3.exports = function(argument) { - return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument); - }; - }, - "./node_modules/core-js/internals/to-length.js": function(module3, exports2, __webpack_require__) { - var toInteger = __webpack_require__("./node_modules/core-js/internals/to-integer.js"); - var min = Math.min; - module3.exports = function(argument) { - return argument > 0 ? min(toInteger(argument), 9007199254740991) : 0; - }; - }, - "./node_modules/core-js/internals/to-object.js": function(module3, exports2, __webpack_require__) { - var requireObjectCoercible = __webpack_require__("./node_modules/core-js/internals/require-object-coercible.js"); - module3.exports = function(argument) { - return Object(requireObjectCoercible(argument)); - }; - }, - "./node_modules/core-js/internals/to-primitive.js": function(module3, exports2, __webpack_require__) { - var isObject = __webpack_require__("./node_modules/core-js/internals/is-object.js"); - module3.exports = function(it, S) { - if (!isObject(it)) - return it; - var fn, val; - if (S && typeof (fn = it.toString) == "function" && !isObject(val = fn.call(it))) - return val; - if (typeof (fn = it.valueOf) == "function" && !isObject(val = fn.call(it))) - return val; - if (!S && typeof (fn = it.toString) == "function" && !isObject(val = fn.call(it))) - return val; - throw TypeError("Can't convert object to primitive value"); - }; - }, - "./node_modules/core-js/internals/uid.js": function(module3, exports2) { - var id = 0; - var postfix = Math.random(); - module3.exports = function(key2) { - return "Symbol(".concat(key2 === void 0 ? "" : key2, ")_", (++id + postfix).toString(36)); - }; - }, - "./node_modules/core-js/internals/validate-set-prototype-of-arguments.js": function(module3, exports2, __webpack_require__) { - var isObject = __webpack_require__("./node_modules/core-js/internals/is-object.js"); - var anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js"); - module3.exports = function(O, proto) { - anObject(O); - if (!isObject(proto) && proto !== null) { - throw TypeError("Can't set " + String(proto) + " as a prototype"); - } - }; - }, - "./node_modules/core-js/internals/well-known-symbol.js": function(module3, exports2, __webpack_require__) { - var global2 = __webpack_require__("./node_modules/core-js/internals/global.js"); - var shared = __webpack_require__("./node_modules/core-js/internals/shared.js"); - var uid = __webpack_require__("./node_modules/core-js/internals/uid.js"); - var NATIVE_SYMBOL = __webpack_require__("./node_modules/core-js/internals/native-symbol.js"); - var Symbol2 = global2.Symbol; - var store = shared("wks"); - module3.exports = function(name) { - return store[name] || (store[name] = NATIVE_SYMBOL && Symbol2[name] || (NATIVE_SYMBOL ? Symbol2 : uid)("Symbol." + name)); - }; - }, - "./node_modules/core-js/modules/es.array.from.js": function(module3, exports2, __webpack_require__) { - var $ = __webpack_require__("./node_modules/core-js/internals/export.js"); - var from = __webpack_require__("./node_modules/core-js/internals/array-from.js"); - var checkCorrectnessOfIteration = __webpack_require__("./node_modules/core-js/internals/check-correctness-of-iteration.js"); - var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function(iterable) { - Array.from(iterable); - }); - $({ target: "Array", stat: true, forced: INCORRECT_ITERATION }, { - from - }); - }, - "./node_modules/core-js/modules/es.string.iterator.js": function(module3, exports2, __webpack_require__) { - "use strict"; - var codePointAt = __webpack_require__("./node_modules/core-js/internals/string-at.js"); - var InternalStateModule = __webpack_require__("./node_modules/core-js/internals/internal-state.js"); - var defineIterator = __webpack_require__("./node_modules/core-js/internals/define-iterator.js"); - var STRING_ITERATOR = "String Iterator"; - var setInternalState = InternalStateModule.set; - var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); - defineIterator(String, "String", function(iterated) { - setInternalState(this, { - type: STRING_ITERATOR, - string: String(iterated), - index: 0 - }); - }, function next() { - var state = getInternalState(this); - var string = state.string; - var index = state.index; - var point; - if (index >= string.length) - return { value: void 0, done: true }; - point = codePointAt(string, index, true); - state.index += point.length; - return { value: point, done: false }; - }); - }, - "./node_modules/webpack/buildin/global.js": function(module3, exports2) { - var g; - g = function() { - return this; - }(); - try { - g = g || Function("return this")() || (1, eval)("this"); - } catch (e) { - if (typeof window === "object") - g = window; - } - module3.exports = g; - }, - "./src/default-attrs.json": function(module3) { - module3.exports = { "xmlns": "http://www.w3.org/2000/svg", "width": 24, "height": 24, "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "stroke-width": 2, "stroke-linecap": "round", "stroke-linejoin": "round" }; - }, - "./src/icon.js": function(module3, exports2, __webpack_require__) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { - value: true - }); - var _extends = Object.assign || function(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key2 in source) { - if (Object.prototype.hasOwnProperty.call(source, key2)) { - target[key2] = source[key2]; - } - } - } - return target; - }; - var _createClass = function() { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; - }(); - var _dedupe = __webpack_require__("./node_modules/classnames/dedupe.js"); - var _dedupe2 = _interopRequireDefault(_dedupe); - var _defaultAttrs = __webpack_require__("./src/default-attrs.json"); - var _defaultAttrs2 = _interopRequireDefault(_defaultAttrs); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function _classCallCheck(instance5, Constructor) { - if (!(instance5 instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - var Icon = function() { - function Icon2(name, contents) { - var tags = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : []; - _classCallCheck(this, Icon2); - this.name = name; - this.contents = contents; - this.tags = tags; - this.attrs = _extends({}, _defaultAttrs2.default, { class: "feather feather-" + name }); - } - _createClass(Icon2, [{ - key: "toSvg", - value: function toSvg() { - var attrs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - var combinedAttrs = _extends({}, this.attrs, attrs, { class: (0, _dedupe2.default)(this.attrs.class, attrs.class) }); - return "" + this.contents + ""; - } - }, { - key: "toString", - value: function toString() { - return this.contents; - } - }]); - return Icon2; - }(); - function attrsToString(attrs) { - return Object.keys(attrs).map(function(key2) { - return key2 + '="' + attrs[key2] + '"'; - }).join(" "); - } - exports2.default = Icon; - }, - "./src/icons.js": function(module3, exports2, __webpack_require__) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { - value: true - }); - var _icon = __webpack_require__("./src/icon.js"); - var _icon2 = _interopRequireDefault(_icon); - var _icons = __webpack_require__("./dist/icons.json"); - var _icons2 = _interopRequireDefault(_icons); - var _tags = __webpack_require__("./src/tags.json"); - var _tags2 = _interopRequireDefault(_tags); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - exports2.default = Object.keys(_icons2.default).map(function(key2) { - return new _icon2.default(key2, _icons2.default[key2], _tags2.default[key2]); - }).reduce(function(object, icon) { - object[icon.name] = icon; - return object; - }, {}); - }, - "./src/index.js": function(module3, exports2, __webpack_require__) { - "use strict"; - var _icons = __webpack_require__("./src/icons.js"); - var _icons2 = _interopRequireDefault(_icons); - var _toSvg = __webpack_require__("./src/to-svg.js"); - var _toSvg2 = _interopRequireDefault(_toSvg); - var _replace = __webpack_require__("./src/replace.js"); - var _replace2 = _interopRequireDefault(_replace); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - module3.exports = { icons: _icons2.default, toSvg: _toSvg2.default, replace: _replace2.default }; - }, - "./src/replace.js": function(module3, exports2, __webpack_require__) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { - value: true - }); - var _extends = Object.assign || function(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key2 in source) { - if (Object.prototype.hasOwnProperty.call(source, key2)) { - target[key2] = source[key2]; - } - } - } - return target; - }; - var _dedupe = __webpack_require__("./node_modules/classnames/dedupe.js"); - var _dedupe2 = _interopRequireDefault(_dedupe); - var _icons = __webpack_require__("./src/icons.js"); - var _icons2 = _interopRequireDefault(_icons); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function replace() { - var attrs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - if (typeof document === "undefined") { - throw new Error("`feather.replace()` only works in a browser environment."); - } - var elementsToReplace = document.querySelectorAll("[data-feather]"); - Array.from(elementsToReplace).forEach(function(element2) { - return replaceElement(element2, attrs); - }); - } - function replaceElement(element2) { - var attrs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - var elementAttrs = getAttrs(element2); - var name = elementAttrs["data-feather"]; - delete elementAttrs["data-feather"]; - var svgString = _icons2.default[name].toSvg(_extends({}, attrs, elementAttrs, { class: (0, _dedupe2.default)(attrs.class, elementAttrs.class) })); - var svgDocument = new DOMParser().parseFromString(svgString, "image/svg+xml"); - var svgElement = svgDocument.querySelector("svg"); - element2.parentNode.replaceChild(svgElement, element2); - } - function getAttrs(element2) { - return Array.from(element2.attributes).reduce(function(attrs, attr2) { - attrs[attr2.name] = attr2.value; - return attrs; - }, {}); - } - exports2.default = replace; - }, - "./src/tags.json": function(module3) { - module3.exports = { "activity": ["pulse", "health", "action", "motion"], "airplay": ["stream", "cast", "mirroring"], "alert-circle": ["warning", "alert", "danger"], "alert-octagon": ["warning", "alert", "danger"], "alert-triangle": ["warning", "alert", "danger"], "align-center": ["text alignment", "center"], "align-justify": ["text alignment", "justified"], "align-left": ["text alignment", "left"], "align-right": ["text alignment", "right"], "anchor": [], "archive": ["index", "box"], "at-sign": ["mention", "at", "email", "message"], "award": ["achievement", "badge"], "aperture": ["camera", "photo"], "bar-chart": ["statistics", "diagram", "graph"], "bar-chart-2": ["statistics", "diagram", "graph"], "battery": ["power", "electricity"], "battery-charging": ["power", "electricity"], "bell": ["alarm", "notification", "sound"], "bell-off": ["alarm", "notification", "silent"], "bluetooth": ["wireless"], "book-open": ["read", "library"], "book": ["read", "dictionary", "booklet", "magazine", "library"], "bookmark": ["read", "clip", "marker", "tag"], "box": ["cube"], "briefcase": ["work", "bag", "baggage", "folder"], "calendar": ["date"], "camera": ["photo"], "cast": ["chromecast", "airplay"], "circle": ["off", "zero", "record"], "clipboard": ["copy"], "clock": ["time", "watch", "alarm"], "cloud-drizzle": ["weather", "shower"], "cloud-lightning": ["weather", "bolt"], "cloud-rain": ["weather"], "cloud-snow": ["weather", "blizzard"], "cloud": ["weather"], "codepen": ["logo"], "codesandbox": ["logo"], "code": ["source", "programming"], "coffee": ["drink", "cup", "mug", "tea", "cafe", "hot", "beverage"], "columns": ["layout"], "command": ["keyboard", "cmd", "terminal", "prompt"], "compass": ["navigation", "safari", "travel", "direction"], "copy": ["clone", "duplicate"], "corner-down-left": ["arrow", "return"], "corner-down-right": ["arrow"], "corner-left-down": ["arrow"], "corner-left-up": ["arrow"], "corner-right-down": ["arrow"], "corner-right-up": ["arrow"], "corner-up-left": ["arrow"], "corner-up-right": ["arrow"], "cpu": ["processor", "technology"], "credit-card": ["purchase", "payment", "cc"], "crop": ["photo", "image"], "crosshair": ["aim", "target"], "database": ["storage", "memory"], "delete": ["remove"], "disc": ["album", "cd", "dvd", "music"], "dollar-sign": ["currency", "money", "payment"], "droplet": ["water"], "edit": ["pencil", "change"], "edit-2": ["pencil", "change"], "edit-3": ["pencil", "change"], "eye": ["view", "watch"], "eye-off": ["view", "watch", "hide", "hidden"], "external-link": ["outbound"], "facebook": ["logo", "social"], "fast-forward": ["music"], "figma": ["logo", "design", "tool"], "file-minus": ["delete", "remove", "erase"], "file-plus": ["add", "create", "new"], "file-text": ["data", "txt", "pdf"], "film": ["movie", "video"], "filter": ["funnel", "hopper"], "flag": ["report"], "folder-minus": ["directory"], "folder-plus": ["directory"], "folder": ["directory"], "framer": ["logo", "design", "tool"], "frown": ["emoji", "face", "bad", "sad", "emotion"], "gift": ["present", "box", "birthday", "party"], "git-branch": ["code", "version control"], "git-commit": ["code", "version control"], "git-merge": ["code", "version control"], "git-pull-request": ["code", "version control"], "github": ["logo", "version control"], "gitlab": ["logo", "version control"], "globe": ["world", "browser", "language", "translate"], "hard-drive": ["computer", "server", "memory", "data"], "hash": ["hashtag", "number", "pound"], "headphones": ["music", "audio", "sound"], "heart": ["like", "love", "emotion"], "help-circle": ["question mark"], "hexagon": ["shape", "node.js", "logo"], "home": ["house", "living"], "image": ["picture"], "inbox": ["email"], "instagram": ["logo", "camera"], "key": ["password", "login", "authentication", "secure"], "layers": ["stack"], "layout": ["window", "webpage"], "life-bouy": ["help", "life ring", "support"], "link": ["chain", "url"], "link-2": ["chain", "url"], "linkedin": ["logo", "social media"], "list": ["options"], "lock": ["security", "password", "secure"], "log-in": ["sign in", "arrow", "enter"], "log-out": ["sign out", "arrow", "exit"], "mail": ["email", "message"], "map-pin": ["location", "navigation", "travel", "marker"], "map": ["location", "navigation", "travel"], "maximize": ["fullscreen"], "maximize-2": ["fullscreen", "arrows", "expand"], "meh": ["emoji", "face", "neutral", "emotion"], "menu": ["bars", "navigation", "hamburger"], "message-circle": ["comment", "chat"], "message-square": ["comment", "chat"], "mic-off": ["record", "sound", "mute"], "mic": ["record", "sound", "listen"], "minimize": ["exit fullscreen", "close"], "minimize-2": ["exit fullscreen", "arrows", "close"], "minus": ["subtract"], "monitor": ["tv", "screen", "display"], "moon": ["dark", "night"], "more-horizontal": ["ellipsis"], "more-vertical": ["ellipsis"], "mouse-pointer": ["arrow", "cursor"], "move": ["arrows"], "music": ["note"], "navigation": ["location", "travel"], "navigation-2": ["location", "travel"], "octagon": ["stop"], "package": ["box", "container"], "paperclip": ["attachment"], "pause": ["music", "stop"], "pause-circle": ["music", "audio", "stop"], "pen-tool": ["vector", "drawing"], "percent": ["discount"], "phone-call": ["ring"], "phone-forwarded": ["call"], "phone-incoming": ["call"], "phone-missed": ["call"], "phone-off": ["call", "mute"], "phone-outgoing": ["call"], "phone": ["call"], "play": ["music", "start"], "pie-chart": ["statistics", "diagram"], "play-circle": ["music", "start"], "plus": ["add", "new"], "plus-circle": ["add", "new"], "plus-square": ["add", "new"], "pocket": ["logo", "save"], "power": ["on", "off"], "printer": ["fax", "office", "device"], "radio": ["signal"], "refresh-cw": ["synchronise", "arrows"], "refresh-ccw": ["arrows"], "repeat": ["loop", "arrows"], "rewind": ["music"], "rotate-ccw": ["arrow"], "rotate-cw": ["arrow"], "rss": ["feed", "subscribe"], "save": ["floppy disk"], "scissors": ["cut"], "search": ["find", "magnifier", "magnifying glass"], "send": ["message", "mail", "email", "paper airplane", "paper aeroplane"], "settings": ["cog", "edit", "gear", "preferences"], "share-2": ["network", "connections"], "shield": ["security", "secure"], "shield-off": ["security", "insecure"], "shopping-bag": ["ecommerce", "cart", "purchase", "store"], "shopping-cart": ["ecommerce", "cart", "purchase", "store"], "shuffle": ["music"], "skip-back": ["music"], "skip-forward": ["music"], "slack": ["logo"], "slash": ["ban", "no"], "sliders": ["settings", "controls"], "smartphone": ["cellphone", "device"], "smile": ["emoji", "face", "happy", "good", "emotion"], "speaker": ["audio", "music"], "star": ["bookmark", "favorite", "like"], "stop-circle": ["media", "music"], "sun": ["brightness", "weather", "light"], "sunrise": ["weather", "time", "morning", "day"], "sunset": ["weather", "time", "evening", "night"], "tablet": ["device"], "tag": ["label"], "target": ["logo", "bullseye"], "terminal": ["code", "command line", "prompt"], "thermometer": ["temperature", "celsius", "fahrenheit", "weather"], "thumbs-down": ["dislike", "bad", "emotion"], "thumbs-up": ["like", "good", "emotion"], "toggle-left": ["on", "off", "switch"], "toggle-right": ["on", "off", "switch"], "tool": ["settings", "spanner"], "trash": ["garbage", "delete", "remove", "bin"], "trash-2": ["garbage", "delete", "remove", "bin"], "triangle": ["delta"], "truck": ["delivery", "van", "shipping", "transport", "lorry"], "tv": ["television", "stream"], "twitch": ["logo"], "twitter": ["logo", "social"], "type": ["text"], "umbrella": ["rain", "weather"], "unlock": ["security"], "user-check": ["followed", "subscribed"], "user-minus": ["delete", "remove", "unfollow", "unsubscribe"], "user-plus": ["new", "add", "create", "follow", "subscribe"], "user-x": ["delete", "remove", "unfollow", "unsubscribe", "unavailable"], "user": ["person", "account"], "users": ["group"], "video-off": ["camera", "movie", "film"], "video": ["camera", "movie", "film"], "voicemail": ["phone"], "volume": ["music", "sound", "mute"], "volume-1": ["music", "sound"], "volume-2": ["music", "sound"], "volume-x": ["music", "sound", "mute"], "watch": ["clock", "time"], "wifi-off": ["disabled"], "wifi": ["connection", "signal", "wireless"], "wind": ["weather", "air"], "x-circle": ["cancel", "close", "delete", "remove", "times", "clear"], "x-octagon": ["delete", "stop", "alert", "warning", "times", "clear"], "x-square": ["cancel", "close", "delete", "remove", "times", "clear"], "x": ["cancel", "close", "delete", "remove", "times", "clear"], "youtube": ["logo", "video", "play"], "zap-off": ["flash", "camera", "lightning"], "zap": ["flash", "camera", "lightning"], "zoom-in": ["magnifying glass"], "zoom-out": ["magnifying glass"] }; - }, - "./src/to-svg.js": function(module3, exports2, __webpack_require__) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { - value: true - }); - var _icons = __webpack_require__("./src/icons.js"); - var _icons2 = _interopRequireDefault(_icons); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function toSvg(name) { - var attrs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - console.warn("feather.toSvg() is deprecated. Please use feather.icons[name].toSvg() instead."); - if (!name) { - throw new Error("The required `key` (icon name) parameter is missing."); - } - if (!_icons2.default[name]) { - throw new Error("No icon matching '" + name + "'. See the complete list of icons at https://feathericons.com"); - } - return _icons2.default[name].toSvg(attrs); - } - exports2.default = toSvg; - }, - 0: function(module3, exports2, __webpack_require__) { - __webpack_require__("./node_modules/core-js/es/array/from.js"); - module3.exports = __webpack_require__("./src/index.js"); - } - }); - }); - } -}); - -// node_modules/tslib/tslib.js -var require_tslib = __commonJS({ - "node_modules/tslib/tslib.js"(exports, module2) { - var __extends2; - var __assign2; - var __rest2; - var __decorate2; - var __param2; - var __metadata2; - var __awaiter2; - var __generator2; - var __exportStar2; - var __values2; - var __read2; - var __spread2; - var __spreadArrays2; - var __spreadArray2; - var __await2; - var __asyncGenerator2; - var __asyncDelegator2; - var __asyncValues2; - var __makeTemplateObject2; - var __importStar2; - var __importDefault2; - var __classPrivateFieldGet2; - var __classPrivateFieldSet2; - var __createBinding2; - (function(factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function(exports2) { - factory(createExporter(root, createExporter(exports2))); - }); - } else if (typeof module2 === "object" && typeof module2.exports === "object") { - factory(createExporter(root, createExporter(module2.exports))); - } else { - factory(createExporter(root)); - } - function createExporter(exports2, previous) { - if (exports2 !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports2, "__esModule", { value: true }); - } else { - exports2.__esModule = true; - } - } - return function(id, v) { - return exports2[id] = previous ? previous(id, v) : v; - }; - } - })(function(exporter) { - var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) { - d.__proto__ = b; - } || function(d, b) { - for (var p in b) - if (Object.prototype.hasOwnProperty.call(b, p)) - d[p] = b[p]; - }; - __extends2 = function(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - __assign2 = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - __rest2 = function(s, e) { - var t = {}; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - __decorate2 = function(decorators, target, key2, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key2) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key2, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key2, r) : d(target, key2)) || r; - return c > 3 && r && Object.defineProperty(target, key2, r), r; - }; - __param2 = function(paramIndex, decorator) { - return function(target, key2) { - decorator(target, key2, paramIndex); - }; - }; - __metadata2 = function(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(metadataKey, metadataValue); - }; - __awaiter2 = 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()); - }); - }; - __generator2 = 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 }; - } - }; - __exportStar2 = function(m, o) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) - __createBinding2(o, m, p); - }; - __createBinding2 = Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }; - __values2 = function(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) - return m.call(o); - if (o && typeof o.length === "number") - return { - next: function() { - if (o && i >= o.length) - o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - __read2 = function(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) - return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) - ar.push(r.value); - } catch (error) { - e = { error }; - } finally { - try { - if (r && !r.done && (m = i["return"])) - m.call(i); - } finally { - if (e) - throw e.error; - } - } - return ar; - }; - __spread2 = function() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read2(arguments[i])); - return ar; - }; - __spreadArrays2 = 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; - }; - __spreadArray2 = function(to, from, pack) { - if (pack || arguments.length === 2) - for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) - ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - __await2 = function(v) { - return this instanceof __await2 ? (this.v = v, this) : new __await2(v); - }; - __asyncGenerator2 = function(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) - throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function verb(n) { - if (g[n]) - i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; - } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); - } - } - function step(r) { - r.value instanceof __await2 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); - } - function fulfill(value) { - resume("next", value); - } - function reject(value) { - resume("throw", value); - } - function settle(f, v) { - if (f(v), q.shift(), q.length) - resume(q[0][0], q[0][1]); - } - }; - __asyncDelegator2 = function(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function(e) { - throw e; - }), verb("return"), i[Symbol.iterator] = function() { - return this; - }, i; - function verb(n, f) { - i[n] = o[n] ? function(v) { - return (p = !p) ? { value: __await2(o[n](v)), done: n === "return" } : f ? f(v) : v; - } : f; - } - }; - __asyncValues2 = function(o) { - if (!Symbol.asyncIterator) - throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values2 === "function" ? __values2(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i); - function verb(n) { - i[n] = o[n] && function(v) { - return new Promise(function(resolve, reject) { - v = o[n](v), settle(resolve, reject, v.done, v.value); - }); - }; - } - function settle(resolve, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve({ value: v2, done: d }); - }, reject); - } - }; - __makeTemplateObject2 = function(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; - }; - var __setModuleDefault = Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }; - __importStar2 = function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding2(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - __importDefault2 = function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - __classPrivateFieldGet2 = function(receiver, state, kind, f) { - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - __classPrivateFieldSet2 = function(receiver, state, value, kind, f) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; - }; - exporter("__extends", __extends2); - exporter("__assign", __assign2); - exporter("__rest", __rest2); - exporter("__decorate", __decorate2); - exporter("__param", __param2); - exporter("__metadata", __metadata2); - exporter("__awaiter", __awaiter2); - exporter("__generator", __generator2); - exporter("__exportStar", __exportStar2); - exporter("__createBinding", __createBinding2); - exporter("__values", __values2); - exporter("__read", __read2); - exporter("__spread", __spread2); - exporter("__spreadArrays", __spreadArrays2); - exporter("__spreadArray", __spreadArray2); - exporter("__await", __await2); - exporter("__asyncGenerator", __asyncGenerator2); - exporter("__asyncDelegator", __asyncDelegator2); - exporter("__asyncValues", __asyncValues2); - exporter("__makeTemplateObject", __makeTemplateObject2); - exporter("__importStar", __importStar2); - exporter("__importDefault", __importDefault2); - exporter("__classPrivateFieldGet", __classPrivateFieldGet2); - exporter("__classPrivateFieldSet", __classPrivateFieldSet2); - }); - } -}); - -// src/main.ts -__export(exports, { - default: () => ObsidianGit -}); -var import_obsidian14 = __toModule(require("obsidian")); -var path2 = __toModule(require("path")); - -// src/promiseQueue.ts -var PromiseQueue = class { - constructor() { - this.tasks = []; - } - addTask(task) { - this.tasks.push(task); - if (this.tasks.length === 1) { - this.handleTask(); - } - } - handleTask() { - return __async(this, null, function* () { - if (this.tasks.length > 0) { - this.tasks[0]().finally(() => { - this.tasks.shift(); - this.handleTask(); - }); - } - }); - } -}; - -// src/settings.ts -var import_obsidian = __toModule(require("obsidian")); -var ObsidianGitSettingsTab = class extends import_obsidian.PluginSettingTab { - display() { - let { containerEl } = this; - const plugin = this.plugin; - containerEl.empty(); - containerEl.createEl("h2", { text: "Git Backup settings" }); - new import_obsidian.Setting(containerEl).setName("Vault backup interval (minutes)").setDesc("Commit and push changes every X minutes. Set to 0 (default) to disable. (See below setting for further configuration!)").addText((text2) => text2.setValue(String(plugin.settings.autoSaveInterval)).onChange((value) => { - if (!isNaN(Number(value))) { - plugin.settings.autoSaveInterval = Number(value); - plugin.saveSettings(); - if (plugin.settings.autoSaveInterval > 0) { - plugin.clearAutoBackup(); - plugin.startAutoBackup(plugin.settings.autoSaveInterval); - new import_obsidian.Notice(`Automatic backup enabled! Every ${plugin.settings.autoSaveInterval} minutes.`); - } else if (plugin.settings.autoSaveInterval <= 0) { - plugin.clearAutoBackup() && new import_obsidian.Notice("Automatic backup disabled!"); - } - } else { - new import_obsidian.Notice("Please specify a valid number."); - } - })); - new import_obsidian.Setting(containerEl).setName("If turned on, do auto backup every X minutes after last change. Prevents auto backup while editing a file. If turned off, do auto backup every X minutes. It's independent from last change.").addToggle((toggle) => toggle.setValue(plugin.settings.autoBackupAfterFileChange).onChange((value) => { - plugin.settings.autoBackupAfterFileChange = value; - plugin.saveSettings(); - plugin.clearAutoBackup(); - if (plugin.settings.autoSaveInterval > 0) { - plugin.startAutoBackup(plugin.settings.autoSaveInterval); - } - })); - new import_obsidian.Setting(containerEl).setName("Auto pull interval (minutes)").setDesc("Pull changes every X minutes. Set to 0 (default) to disable.").addText((text2) => text2.setValue(String(plugin.settings.autoPullInterval)).onChange((value) => { - if (!isNaN(Number(value))) { - plugin.settings.autoPullInterval = Number(value); - plugin.saveSettings(); - if (plugin.settings.autoPullInterval > 0) { - plugin.clearAutoPull(); - plugin.startAutoPull(plugin.settings.autoPullInterval); - new import_obsidian.Notice(`Automatic pull enabled! Every ${plugin.settings.autoPullInterval} minutes.`); - } else if (plugin.settings.autoPullInterval <= 0) { - plugin.clearAutoPull() && new import_obsidian.Notice("Automatic pull disabled!"); - } - } else { - new import_obsidian.Notice("Please specify a valid number."); - } - })); - new import_obsidian.Setting(containerEl).setName("Sync Method").setDesc("Selects the method used for handling new changes found in your remote git repository.").addDropdown((dropdown) => { - const options = { - "merge": "Merge", - "rebase": "Rebase", - "reset": "Other sync service (Only updates the HEAD without touching the working directory)" - }; - dropdown.addOptions(options); - dropdown.setValue(plugin.settings.syncMethod); - dropdown.onChange((option) => __async(this, null, function* () { - plugin.settings.syncMethod = option; - plugin.saveSettings(); - })); - }); - new import_obsidian.Setting(containerEl).setName("Commit message on manual backup/commit").setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below) and {{numFiles}} (number of changed files in the commit)").addText((text2) => text2.setPlaceholder("vault backup: {{date}}").setValue(plugin.settings.commitMessage ? plugin.settings.commitMessage : "").onChange((value) => { - plugin.settings.commitMessage = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Commit message on auto backup").setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below) and {{numFiles}} (number of changed files in the commit)").addText((text2) => text2.setPlaceholder("vault backup: {{date}}").setValue(plugin.settings.autoCommitMessage).onChange((value) => { - plugin.settings.autoCommitMessage = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("{{date}} placeholder format").setDesc('Specify custom date format. E.g. "YYYY-MM-DD HH:mm:ss"').addText((text2) => text2.setPlaceholder(plugin.settings.commitDateFormat).setValue(plugin.settings.commitDateFormat).onChange((value) => __async(this, null, function* () { - plugin.settings.commitDateFormat = value; - yield plugin.saveSettings(); - }))); - new import_obsidian.Setting(containerEl).setName("{{hostname}} placeholder replacement").setDesc("Specify custom hostname for every device.").addText((text2) => text2.setValue(localStorage.getItem(plugin.manifest.id + ":hostname")).onChange((value) => __async(this, null, function* () { - localStorage.setItem(plugin.manifest.id + ":hostname", value); - }))); - new import_obsidian.Setting(containerEl).setName("Preview commit message").addButton((button) => button.setButtonText("Preview").onClick(() => __async(this, null, function* () { - let commitMessagePreview = yield plugin.gitManager.formatCommitMessage(plugin.settings.commitMessage); - new import_obsidian.Notice(`${commitMessagePreview}`); - }))); - new import_obsidian.Setting(containerEl).setName("List filenames affected by commit in the commit body").addToggle((toggle) => toggle.setValue(plugin.settings.listChangedFilesInMessageBody).onChange((value) => { - plugin.settings.listChangedFilesInMessageBody = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Specify custom commit message on auto backup").setDesc("You will get a pop up to specify your message").addToggle((toggle) => toggle.setValue(plugin.settings.customMessageOnAutoBackup).onChange((value) => { - plugin.settings.customMessageOnAutoBackup = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Current branch").setDesc("Switch to a different branch").addDropdown((dropdown) => __async(this, null, function* () { - const branchInfo = yield plugin.gitManager.branchInfo(); - for (const branch of branchInfo.branches) { - dropdown.addOption(branch, branch); - } - dropdown.setValue(branchInfo.current); - dropdown.onChange((option) => __async(this, null, function* () { - yield plugin.gitManager.checkout(option); - new import_obsidian.Notice(`Checked out to ${option}`); - })); - })); - new import_obsidian.Setting(containerEl).setName("Pull updates on startup").setDesc("Automatically pull updates when Obsidian starts").addToggle((toggle) => toggle.setValue(plugin.settings.autoPullOnBoot).onChange((value) => { - plugin.settings.autoPullOnBoot = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Disable push").setDesc("Do not push changes to the remote repository").addToggle((toggle) => toggle.setValue(plugin.settings.disablePush).onChange((value) => { - plugin.settings.disablePush = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Pull changes before push").setDesc("Commit -> pull -> push (Only if pushing is enabled)").addToggle((toggle) => toggle.setValue(plugin.settings.pullBeforePush).onChange((value) => { - plugin.settings.pullBeforePush = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Automatically refresh Source Control View on file changes").setDesc("On slower machines this may cause lags. If so, just disable this option").addToggle((toggle) => toggle.setValue(plugin.settings.refreshSourceControl).onChange((value) => { - plugin.settings.refreshSourceControl = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Update submodules").setDesc('"Create backup" and "pull" takes care of submodules. Missing features: Conflicted files, count of pulled/pushed/committed files. Tracking branch needs to be set for each submodule').addToggle((toggle) => toggle.setValue(plugin.settings.updateSubmodules).onChange((value) => { - plugin.settings.updateSubmodules = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Disable notifications").setDesc("Disable notifications for git operations to minimize distraction (refer to status bar for updates)").addToggle((toggle) => toggle.setValue(plugin.settings.disablePopups).onChange((value) => { - plugin.settings.disablePopups = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Show status bar").setDesc("Obsidian must be restarted for the changes to take affect").addToggle((toggle) => toggle.setValue(plugin.settings.showStatusBar).onChange((value) => { - plugin.settings.showStatusBar = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Custom Git binary path").addText((cb) => { - cb.setValue(plugin.settings.gitPath); - cb.setPlaceholder("git"); - cb.onChange((value) => { - plugin.settings.gitPath = value; - plugin.saveSettings(); - plugin.gitManager.updateGitPath(value || "git"); - }); - }); - const info = containerEl.createDiv(); - info.setAttr("align", "center"); - info.setText("Debugging and logging:\nYou can always see the logs of this and every other plugin by opening the console with"); - const keys = containerEl.createDiv(); - keys.setAttr("align", "center"); - keys.addClass("obsidian-git-shortcuts"); - if (import_obsidian.Platform.isMacOS === true) { - keys.createEl("kbd", { text: "CMD (\u2318) + OPTION (\u2325) + I" }); - } else { - keys.createEl("kbd", { text: "CTRL + SHIFT + I" }); - } - } -}; - -// src/statusBar.ts -var import_obsidian2 = __toModule(require("obsidian")); - -// src/types.ts -var PluginState; -(function(PluginState2) { - PluginState2[PluginState2["idle"] = 0] = "idle"; - PluginState2[PluginState2["status"] = 1] = "status"; - PluginState2[PluginState2["pull"] = 2] = "pull"; - PluginState2[PluginState2["add"] = 3] = "add"; - PluginState2[PluginState2["commit"] = 4] = "commit"; - PluginState2[PluginState2["push"] = 5] = "push"; - PluginState2[PluginState2["conflicted"] = 6] = "conflicted"; -})(PluginState || (PluginState = {})); - -// src/statusBar.ts -var StatusBar = class { - constructor(statusBarEl, plugin) { - this.statusBarEl = statusBarEl; - this.plugin = plugin; - this.messages = []; - this.base = "obsidian-git-statusbar-"; - this.statusBarEl.setAttribute("aria-label-position", "top"); - } - displayMessage(message, timeout) { - this.messages.push({ - message: `Git: ${message.slice(0, 100)}`, - timeout - }); - this.display(); - } - display() { - if (this.messages.length > 0 && !this.currentMessage) { - this.currentMessage = this.messages.shift(); - this.statusBarEl.addClass(this.base + "message"); - this.statusBarEl.ariaLabel = ""; - this.statusBarEl.setText(this.currentMessage.message); - this.lastMessageTimestamp = Date.now(); - } else if (this.currentMessage) { - const messageAge = Date.now() - this.lastMessageTimestamp; - if (messageAge >= this.currentMessage.timeout) { - this.currentMessage = null; - this.lastMessageTimestamp = null; - } - } else { - this.displayState(); - } - } - displayState() { - switch (this.plugin.state) { - case PluginState.idle: - this.displayFromNow(this.plugin.lastUpdate); - break; - case PluginState.status: - this.statusBarEl.ariaLabel = "Checking repository status..."; - (0, import_obsidian2.setIcon)(this.statusBarEl, "feather-refresh-cw"); - this.statusBarEl.addClass(this.base + "status"); - break; - case PluginState.add: - this.statusBarEl.ariaLabel = "Adding files..."; - (0, import_obsidian2.setIcon)(this.statusBarEl, "feather-refresh-w"); - this.statusBarEl.addClass(this.base + "add"); - break; - case PluginState.commit: - this.statusBarEl.ariaLabel = "Committing changes..."; - (0, import_obsidian2.setIcon)(this.statusBarEl, "feather-git-commit"); - this.statusBarEl.addClass(this.base + "commit"); - break; - case PluginState.push: - this.statusBarEl.ariaLabel = "Pushing changes..."; - (0, import_obsidian2.setIcon)(this.statusBarEl, "feather-upload"); - this.statusBarEl.addClass(this.base + "push"); - break; - case PluginState.pull: - this.statusBarEl.ariaLabel = "Pulling changes..."; - (0, import_obsidian2.setIcon)(this.statusBarEl, "feather-download"); - this.statusBarEl.addClass(this.base + "pull"); - break; - case PluginState.conflicted: - this.statusBarEl.ariaLabel = "You have conflict files..."; - (0, import_obsidian2.setIcon)(this.statusBarEl, "feather-alert-circle"); - this.statusBarEl.addClass(this.base + "conflict"); - break; - default: - this.statusBarEl.ariaLabel = "Failed on initialization!"; - (0, import_obsidian2.setIcon)(this.statusBarEl, "feather-alert-triangle"); - this.statusBarEl.addClass(this.base + "failed-init"); - break; - } - } - displayFromNow(timestamp) { - if (timestamp) { - const moment = window.moment; - const fromNow = moment(timestamp).fromNow(); - this.statusBarEl.ariaLabel = `Last Git update: ${fromNow}`; - } else { - this.statusBarEl.ariaLabel = "Git is ready"; - } - (0, import_obsidian2.setIcon)(this.statusBarEl, "feather-check"); - this.statusBarEl.addClass(this.base + "idle"); - } -}; - -// src/ui/modals/changedFilesModal.ts -var import_obsidian3 = __toModule(require("obsidian")); -var ChangedFilesModal = class extends import_obsidian3.FuzzySuggestModal { - constructor(plugin, changedFiles) { - super(plugin.app); - this.plugin = plugin; - this.changedFiles = changedFiles; - this.setPlaceholder("Not supported files will be opened by default app!"); - } - getItems() { - return this.changedFiles; - } - getItemText(item) { - if (item.index == "?" && item.working_dir == "U") { - return `Untracked | ${item.path}`; - } - let working_dir = ""; - let index = ""; - if (item.working_dir != " ") - working_dir = `Working dir: ${item.working_dir} `; - if (item.index != " ") - index = `Index: ${item.index}`; - return `${working_dir}${index} | ${item.path}`; - } - onChooseItem(item, _) { - if (this.plugin.app.metadataCache.getFirstLinkpathDest(item.path, "") == null) { - this.app.openWithDefaultApp(item.path); - } else { - this.plugin.app.workspace.openLinkText(item.path, "/"); - } - } -}; - -// src/ui/modals/customMessageModal.ts -var import_obsidian4 = __toModule(require("obsidian")); -var CustomMessageModal = class extends import_obsidian4.SuggestModal { - constructor(plugin, fromAutoBackup) { - super(plugin.app); - this.fromAutoBackup = fromAutoBackup; - this.resolve = null; - this.plugin = plugin; - this.setPlaceholder("Type your message and select optional the version with the added date."); - } - open() { - super.open(); - return new Promise((resolve) => { - this.resolve = resolve; - }); - } - onClose() { - if (this.resolve) - this.resolve(void 0); - } - selectSuggestion(value, evt) { - if (this.resolve) - this.resolve(value); - super.selectSuggestion(value, evt); - } - getSuggestions(query) { - const date = window.moment().format(this.plugin.settings.commitDateFormat); - if (query == "") - query = "..."; - return [query, `${date}: ${query}`, `${query}: ${date}`]; - } - renderSuggestion(value, el) { - el.innerText = value; - } - onChooseSuggestion(item, _) { - } -}; - -// src/constants.ts -var DEFAULT_SETTINGS = { - commitMessage: "vault backup: {{date}}", - autoCommitMessage: void 0, - commitDateFormat: "YYYY-MM-DD HH:mm:ss", - autoSaveInterval: 0, - autoPullInterval: 0, - autoPullOnBoot: false, - disablePush: false, - pullBeforePush: true, - disablePopups: false, - listChangedFilesInMessageBody: false, - showStatusBar: true, - updateSubmodules: false, - syncMethod: "merge", - gitPath: "", - customMessageOnAutoBackup: false, - autoBackupAfterFileChange: false, - treeStructure: false, - refreshSourceControl: true -}; -var GIT_VIEW_CONFIG = { - type: "git-view", - name: "Source Control", - icon: "feather-git-pull-request" -}; -var DIFF_VIEW_CONFIG = { - type: "diff-view", - name: "Diff View", - icon: "feather-git-pull-request" -}; - -// src/openInGitHub.ts -var import_electron = __toModule(require("electron")); -var import_obsidian5 = __toModule(require("obsidian")); -function openLineInGitHub(editor, file, manager) { - return __async(this, null, function* () { - const { isGitHub, branch, repo, user } = yield getData(manager); - if (isGitHub) { - const from = editor.getCursor("from").line + 1; - const to = editor.getCursor("to").line + 1; - if (from === to) { - yield import_electron.shell.openExternal(`https://github.com/${user}/${repo}/blob/${branch}/${file.path}?plain=1#L${from}`); - } else { - yield import_electron.shell.openExternal(`https://github.com/${user}/${repo}/blob/${branch}/${file.path}?plain=1#L${from}-L${to}`); - } - } else { - new import_obsidian5.Notice("It seems like you are not using GitHub"); - } - }); -} -function openHistoryInGitHub(file, manager) { - return __async(this, null, function* () { - const { isGitHub, branch, repo, user } = yield getData(manager); - if (isGitHub) { - yield import_electron.shell.openExternal(`https://github.com/${user}/${repo}/commits/${branch}/${file.path}`); - } else { - new import_obsidian5.Notice("It seems like you are not using GitHub"); - } - }); -} -function getData(manager) { - return __async(this, null, function* () { - const branchInfo = yield manager.branchInfo(); - const remoteBranch = branchInfo.tracking; - const branch = branchInfo.current; - const remote = remoteBranch.substring(0, remoteBranch.indexOf("/")); - const remoteUrl = yield manager.getConfig(`remote.${remote}.url`); - const [isGitHub, httpsUser, httpsRepo, sshUser, sshRepo] = remoteUrl.match(/(?:^https:\/\/github\.com\/(.*)\/(.*)\.git$)|(?:^git@github\.com:(.*)\/(.*)\.git$)/); - return { - isGitHub: !!isGitHub, - repo: httpsRepo || sshRepo, - user: httpsUser || sshUser, - branch - }; - }); -} - -// src/simpleGit.ts -var import_child_process = __toModule(require("child_process")); -var path = __toModule(require("path")); -var simple = __toModule(require_src3()); - -// src/gitManager.ts -var GitManager = class { - constructor(plugin) { - this.plugin = plugin; - this.app = plugin.app; - } - getTreeStructure(children2, beginLength = 0) { - let list = []; - children2 = [...children2]; - while (children2.length > 0) { - const first = children2.first(); - const restPath = first.path.substring(beginLength); - if (restPath.contains("/")) { - const title = restPath.substring(0, restPath.indexOf("/")); - const childrenWithSameTitle = children2.filter((item) => { - return item.path.substring(beginLength).startsWith(title + "/"); - }); - childrenWithSameTitle.forEach((item) => children2.remove(item)); - list.push({ - title, - children: this.getTreeStructure(childrenWithSameTitle, (beginLength > 0 ? beginLength + title.length : title.length) + 1) - }); - } else { - list.push({ title: restPath, statusResult: first }); - children2.remove(first); - } - } - return list; - } - formatCommitMessage(template) { - return __async(this, null, function* () { - let status; - if (template.includes("{{numFiles}}")) { - status = yield this.status(); - let numFiles = status.staged.length; - template = template.replace("{{numFiles}}", String(numFiles)); - } - if (template.includes("{{hostname}}")) { - const hostname = localStorage.getItem(this.plugin.manifest.id + ":hostname") || ""; - template = template.replace("{{hostname}}", hostname); - } - if (template.includes("{{files}}")) { - status = status != null ? status : yield this.status(); - let changeset = {}; - status.staged.forEach((value) => { - if (value.index in changeset) { - changeset[value.index].push(value.path); - } else { - changeset[value.index] = [value.path]; - } - }); - let chunks = []; - for (let [action, files2] of Object.entries(changeset)) { - chunks.push(action + " " + files2.join(" ")); - } - let files = chunks.join(", "); - template = template.replace("{{files}}", files); - } - let moment = window.moment; - template = template.replace("{{date}}", moment().format(this.plugin.settings.commitDateFormat)); - if (this.plugin.settings.listChangedFilesInMessageBody) { - template = template + "\n\nAffected files:\n" + (status != null ? status : yield this.status()).staged.map((e) => e.path).join("\n"); - } - return template; - }); - } -}; - -// src/simpleGit.ts -var SimpleGit = class extends GitManager { - constructor(plugin) { - super(plugin); - this.setGitInstance(); - } - setGitInstance() { - return __async(this, null, function* () { - if (this.isGitInstalled()) { - const adapter = this.app.vault.adapter; - const path3 = adapter.getBasePath(); - this.git = (0, simple.default)({ - baseDir: path3, - binary: this.plugin.settings.gitPath || void 0, - config: ["core.quotepath=off"] - }); - this.git.cwd(yield this.git.revparse("--show-toplevel")); - } - }); - } - status() { - return __async(this, null, function* () { - this.plugin.setState(PluginState.status); - const status = yield this.git.status((err) => this.onError(err)); - this.plugin.setState(PluginState.idle); - return { - changed: status.files.filter((e) => e.working_dir !== " ").map((e) => { - const res = this.formatPath(e.path); - e.path = res.path; - e.from = res.from; - e.working_dir = e.working_dir === "?" ? "U" : e.working_dir; - return e; - }), - staged: status.files.filter((e) => e.index !== " " && e.index != "?").map((e) => { - const res = this.formatPath(e.path, e.index === "R"); - e.path = res.path; - e.from = res.from; - return e; - }), - conflicted: status.conflicted.map((e) => this.formatPath(e).path) - }; - }); - } - formatPath(path3, renamed = false) { - function format(path4) { - if (path4.startsWith('"') && path4.endsWith('"')) { - return path4.substring(1, path4.length - 1); - } else { - return path4; - } - } - if (renamed) { - const paths = path3.split(" -> ").map((e) => format(e)); - return { - from: paths[0], - path: paths[1] - }; - } else { - return { - path: format(path3) - }; - } - } - commitAll(message) { - return __async(this, null, function* () { - if (this.plugin.settings.updateSubmodules) { - this.plugin.setState(PluginState.commit); - yield this.git.subModule(["foreach", "--recursive", `git add -A && if [ ! -z "$(git status --porcelain)" ]; then git commit -m "${yield this.formatCommitMessage(message)}"; fi`], (err) => this.onError(err)); - } - this.plugin.setState(PluginState.add); - yield this.git.add("-A", (err) => this.onError(err)); - this.plugin.setState(PluginState.commit); - return (yield this.git.commit(yield this.formatCommitMessage(message), (err) => this.onError(err))).summary.changes; - }); - } - commit(message) { - return __async(this, null, function* () { - this.plugin.setState(PluginState.commit); - const res = (yield this.git.commit(yield this.formatCommitMessage(message), (err) => this.onError(err))).summary.changes; - this.plugin.setState(PluginState.idle); - return res; - }); - } - stage(filepath) { - return __async(this, null, function* () { - this.plugin.setState(PluginState.add); - yield this.git.add(["--", filepath], (err) => this.onError(err)); - this.plugin.setState(PluginState.idle); - }); - } - stageAll() { - return __async(this, null, function* () { - this.plugin.setState(PluginState.add); - yield this.git.add("-A", (err) => this.onError(err)); - this.plugin.setState(PluginState.idle); - }); - } - unstageAll() { - return __async(this, null, function* () { - this.plugin.setState(PluginState.add); - yield this.git.reset([], (err) => this.onError(err)); - this.plugin.setState(PluginState.idle); - }); - } - unstage(filepath) { - return __async(this, null, function* () { - this.plugin.setState(PluginState.add); - yield this.git.reset(["--", filepath], (err) => this.onError(err)); - this.plugin.setState(PluginState.idle); - }); - } - discard(filepath) { - return __async(this, null, function* () { - this.plugin.setState(PluginState.add); - yield this.git.checkout(["--", filepath], (err) => this.onError(err)); - this.plugin.setState(PluginState.idle); - }); - } - pull() { - return __async(this, null, function* () { - this.plugin.setState(PluginState.pull); - if (this.plugin.settings.updateSubmodules) - yield this.git.subModule(["update", "--remote", "--merge", "--recursive"], (err) => this.onError(err)); - const branchInfo = yield this.branchInfo(); - const localCommit = yield this.git.revparse([branchInfo.tracking], (err) => this.onError(err)); - yield this.git.fetch((err) => this.onError(err)); - const upstreamCommit = yield this.git.revparse([branchInfo.tracking], (err) => this.onError(err)); - if (localCommit !== upstreamCommit) { - if (this.plugin.settings.syncMethod === "merge" || this.plugin.settings.syncMethod === "rebase") { - try { - switch (this.plugin.settings.syncMethod) { - case "merge": - yield this.git.merge([branchInfo.tracking]); - break; - case "rebase": - yield this.git.rebase([branchInfo.tracking]); - } - } catch (err) { - this.plugin.displayError(`Pull failed (${this.plugin.settings.syncMethod}): ${err.message}`); - const status = yield this.status(); - if (status.conflicted.length > 0) { - this.plugin.handleConflict(status.conflicted); - } - return; - } - } else if (this.plugin.settings.syncMethod === "reset") { - try { - yield this.git.raw(["update-ref", `refs/heads/${branchInfo.current}`, upstreamCommit], (err) => this.onError(err)); - yield this.unstageAll(); - } catch (err) { - this.plugin.displayError(`Sync failed (${this.plugin.settings.syncMethod}): ${err.message}`); - } - } - console.log(localCommit); - const filesChanged = yield this.git.diff([`${localCommit}..${upstreamCommit}`, "--name-only"]); - return filesChanged.split(/\r\n|\r|\n/).filter((value) => value.length > 0).length; - } else { - return 0; - } - }); - } - push() { - return __async(this, null, function* () { - this.plugin.setState(PluginState.status); - const status = yield this.git.status(); - const trackingBranch = status.tracking; - const currentBranch = status.current; - const remoteChangedFiles = (yield this.git.diffSummary([currentBranch, trackingBranch])).changed; - this.plugin.setState(PluginState.push); - if (this.plugin.settings.updateSubmodules) { - yield this.git.env(__spreadProps(__spreadValues({}, process.env), { "OBSIDIAN_GIT": 1 })).subModule(["foreach", "--recursive", `tracking=$(git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)"); echo $tracking; if [ ! -z "$(git diff --shortstat $tracking)" ]; then git push; fi`], (err) => this.onError(err)); - } - yield this.git.env(__spreadProps(__spreadValues({}, process.env), { "OBSIDIAN_GIT": 1 })).push((err) => this.onError(err)); - return remoteChangedFiles; - }); - } - canPush() { - return __async(this, null, function* () { - if (this.plugin.settings.updateSubmodules === true) { - return true; - } - const status = yield this.git.status((err) => this.onError(err)); - const trackingBranch = status.tracking; - const currentBranch = status.current; - const remoteChangedFiles = (yield this.git.diffSummary([currentBranch, trackingBranch])).changed; - return remoteChangedFiles !== 0; - }); - } - checkRequirements() { - return __async(this, null, function* () { - if (!this.isGitInstalled()) { - return "missing-git"; - } - if (!(yield this.git.checkIsRepo())) { - return "missing-repo"; - } - return "valid"; - }); - } - branchInfo() { - return __async(this, null, function* () { - const status = yield this.git.status((err) => this.onError(err)); - const branches = yield this.git.branch(["--no-color"], (err) => this.onError(err)); - return { - current: status.current, - tracking: status.tracking, - branches: branches.all - }; - }); - } - checkout(branch) { - return __async(this, null, function* () { - yield this.git.checkout(branch, (err) => this.onError(err)); - }); - } - init() { - return __async(this, null, function* () { - yield this.git.init(false, (err) => this.onError(err)); - }); - } - clone(url, dir) { - return __async(this, null, function* () { - yield this.git.clone(url, path.join(this.app.vault.adapter.getBasePath(), dir), [], (err) => this.onError(err)); - }); - } - setConfig(path3, value) { - return __async(this, null, function* () { - yield this.git.addConfig(path3, value, (err) => this.onError(err)); - }); - } - getConfig(path3) { - return __async(this, null, function* () { - const config = yield this.git.listConfig((err) => this.onError(err)); - return config.all[path3]; - }); - } - fetch(remote) { - return __async(this, null, function* () { - yield this.git.fetch(remote != void 0 ? [remote] : [], (err) => this.onError(err)); - }); - } - setRemote(name, url) { - return __async(this, null, function* () { - if ((yield this.getRemotes()).includes(name)) - yield this.git.remote(["set-url", name, url], (err) => this.onError(err)); - else { - yield this.git.remote(["add", name, url], (err) => this.onError(err)); - } - }); - } - getRemoteBranches(remote) { - return __async(this, null, function* () { - const res = yield this.git.branch(["-r", "--list", `${remote}*`], (err) => this.onError(err)); - const list = []; - for (var item in res.branches) { - list.push(res.branches[item].name); - } - return list; - }); - } - getRemotes() { - return __async(this, null, function* () { - const res = yield this.git.remote([], (err) => this.onError(err)); - if (res) { - return res.trim().split("\n"); - } else { - return []; - } - }); - } - removeRemote(remoteName) { - return __async(this, null, function* () { - yield this.git.removeRemote(remoteName); - }); - } - updateUpstreamBranch(remoteBranch) { - return __async(this, null, function* () { - yield this.git.push(["--set-upstream", ...remoteBranch.split("/")], (err) => this.onError(err)); - }); - } - updateGitPath(gitPath) { - this.setGitInstance(); - } - getDiffString(filePath) { - return __async(this, null, function* () { - return yield this.git.diff([filePath]); - }); - } - isGitInstalled() { - const command = (0, import_child_process.spawnSync)(this.plugin.settings.gitPath || "git", ["--version"], { - stdio: "ignore" - }); - if (command.error) { - console.error(command.error); - return false; - } - return true; - } - onError(error) { - if (error) { - this.plugin.displayError(error.message); - this.plugin.setState(PluginState.idle); - } - } -}; - -// src/ui/diff/diffView.ts -var import_diff2html = __toModule(require_diff2html()); -var import_obsidian6 = __toModule(require("obsidian")); -var DiffView = class extends import_obsidian6.ItemView { - constructor(leaf, plugin) { - super(leaf); - this.plugin = plugin; - this.gettingDiff = false; - this.parser = new DOMParser(); - this.registerEvent(this.app.workspace.on("active-leaf-change", (leaf2) => { - if (leaf2.view instanceof import_obsidian6.MarkdownView) { - this.filePath = leaf2.view.file.path; - } else { - this.filePath = null; - } - this.refresh(); - })); - addEventListener("diff-update", this.firstOpen.bind(this)); - this.intervalId = window.setInterval(() => this.refresh(), 1e4); - this.registerInterval(this.intervalId); - } - firstOpen(event) { - this.filePath = event.detail.path; - this.refresh(); - } - getViewType() { - return DIFF_VIEW_CONFIG.type; - } - getDisplayText() { - return DIFF_VIEW_CONFIG.name; - } - getIcon() { - return DIFF_VIEW_CONFIG.icon; - } - onClose() { - removeEventListener("diff-update", this.firstOpen.bind(this)); - window.clearInterval(this.intervalId); - return super.onClose(); - } - onOpen() { - this.refresh(); - return super.onOpen(); - } - refresh() { - return __async(this, null, function* () { - if (this.filePath && !this.gettingDiff) { - if (!this.app.vault.getAbstractFileByPath(this.filePath)) { - this.contentEl.empty(); - const div = this.contentEl.createDiv({ cls: "diff-err" }); - div.createSpan({ text: "\u26A0\uFE0F", cls: "diff-err-sign" }); - div.createEl("br"); - div.createSpan({ text: this.filePath + " was deleted" }); - } else { - this.gettingDiff = true; - const diff = this.parser.parseFromString((0, import_diff2html.html)(yield this.plugin.gitManager.getDiffString(this.filePath)), "text/html").querySelector(".d2h-file-diff"); - this.contentEl.empty(); - if (diff) { - this.contentEl.append(diff); - } else { - const div = this.contentEl.createDiv({ cls: "diff-err" }); - div.createSpan({ text: "\u26A0\uFE0F", cls: "diff-err-sign" }); - div.createEl("br"); - div.createSpan({ text: "No changes to" + this.filePath }); - } - this.gettingDiff = false; - } - } - }); - } -}; - -// node_modules/obsidian-community-lib/dist/utils.js -var feather = __toModule(require_feather()); -var import_obsidian7 = __toModule(require("obsidian")); -function addFeatherIcon(name, attr2 = { viewBox: "0 0 24 24", width: "100", height: "100" }) { - if (feather.icons[name]) { - const iconName = `feather-${name}`; - (0, import_obsidian7.addIcon)(iconName, feather.icons[name].toSvg(attr2)); - return iconName; - } else { - throw Error(`This Icon (${name}) doesn't exist in the Feather Library.`); - } -} -function hoverPreview(event, view, to) { - const targetEl = event.target; - view.app.workspace.trigger("hover-link", { - event, - source: view.getViewType(), - hoverParent: view, - targetEl, - linktext: to - }); -} -function createNewMDNote(app, newName, currFilePath = "") { - return __async(this, null, function* () { - const newFileFolder = app.fileManager.getNewFileParent(currFilePath).path; - const newFilePath = (0, import_obsidian7.normalizePath)(`${newFileFolder}${newFileFolder === "/" ? "" : "/"}${addMD(newName)}`); - return yield app.vault.create(newFilePath, ""); - }); -} -var addMD = (noteName) => { - return noteName.endsWith(".md") ? noteName : noteName + ".md"; -}; -function openOrSwitch(_0, _1, _2) { - return __async(this, arguments, function* (app, dest, event, options = { createNewFile: true }) { - const { workspace } = app; - let destFile = app.metadataCache.getFirstLinkpathDest(dest, ""); - if (!destFile && options.createNewFile) { - destFile = yield createNewMDNote(app, dest); - } else if (!destFile && !options.createNewFile) - return; - const leavesWithDestAlreadyOpen = []; - workspace.iterateAllLeaves((leaf) => { - var _a; - if (leaf.view instanceof import_obsidian7.MarkdownView) { - const file = (_a = leaf.view) === null || _a === void 0 ? void 0 : _a.file; - if (file && file.basename + "." + file.extension === dest) { - leavesWithDestAlreadyOpen.push(leaf); - } - } - }); - if (leavesWithDestAlreadyOpen.length > 0) { - workspace.setActiveLeaf(leavesWithDestAlreadyOpen[0]); - } else { - const mode = app.vault.getConfig("defaultViewMode"); - const leaf = event.ctrlKey || event.getModifierState("Meta") ? workspace.splitActiveLeaf() : workspace.getUnpinnedLeaf(); - yield leaf.openFile(destFile, { active: true, mode }); - } - }); -} - -// src/ui/icons.ts -function addIcons() { - addFeatherIcon("git-pull-request"); - addFeatherIcon("check"); - addFeatherIcon("refresh-cw"); - addFeatherIcon("plus-circle"); - addFeatherIcon("minus-circle"); - addFeatherIcon("upload"); - addFeatherIcon("download"); - addFeatherIcon("plus"); - addFeatherIcon("skip-back"); - addFeatherIcon("minus"); - addFeatherIcon("alert-circle"); - addFeatherIcon("alert-triangle"); - addFeatherIcon("git-commit"); - addFeatherIcon("edit"); - addFeatherIcon("folder"); - addFeatherIcon("list"); -} - -// src/ui/modals/generalModal.ts -var import_obsidian8 = __toModule(require("obsidian")); -var GeneralModal = class extends import_obsidian8.SuggestModal { - constructor(app, remotes, placeholder) { - super(app); - this.resolve = null; - this.list = remotes; - this.setPlaceholder(placeholder); - } - open() { - super.open(); - return new Promise((resolve) => { - this.resolve = resolve; - }); - } - selectSuggestion(value, evt) { - if (this.resolve) - this.resolve(value); - super.selectSuggestion(value, evt); - } - onClose() { - if (this.resolve) - this.resolve(void 0); - } - getSuggestions(query) { - return [query.length > 0 ? query : "...", ...this.list]; - } - renderSuggestion(value, el) { - el.innerText = value; - } - onChooseSuggestion(item, _) { - } -}; - -// src/ui/sidebar/sidebarView.ts -var import_obsidian13 = __toModule(require("obsidian")); - -// node_modules/svelte/internal/index.mjs -function noop() { -} -var identity = (x) => x; -function run(fn) { - return fn(); -} -function blank_object() { - return Object.create(null); -} -function run_all(fns) { - fns.forEach(run); -} -function is_function(thing) { - return typeof thing === "function"; -} -function safe_not_equal(a, b) { - return a != a ? b == b : a !== b || (a && typeof a === "object" || typeof a === "function"); -} -function is_empty(obj) { - return Object.keys(obj).length === 0; -} -var is_client = typeof window !== "undefined"; -var now = is_client ? () => window.performance.now() : () => Date.now(); -var raf = is_client ? (cb) => requestAnimationFrame(cb) : noop; -var tasks = new Set(); -function run_tasks(now2) { - tasks.forEach((task) => { - if (!task.c(now2)) { - tasks.delete(task); - task.f(); - } - }); - if (tasks.size !== 0) - raf(run_tasks); -} -function loop(callback) { - let task; - if (tasks.size === 0) - raf(run_tasks); - return { - promise: new Promise((fulfill) => { - tasks.add(task = { c: callback, f: fulfill }); - }), - abort() { - tasks.delete(task); - } - }; -} -var is_hydrating = false; -function start_hydrating() { - is_hydrating = true; -} -function end_hydrating() { - is_hydrating = false; -} -function append(target, node) { - target.appendChild(node); -} -function append_styles(target, style_sheet_id, styles) { - const append_styles_to = get_root_for_style(target); - if (!append_styles_to.getElementById(style_sheet_id)) { - const style = element("style"); - style.id = style_sheet_id; - style.textContent = styles; - append_stylesheet(append_styles_to, style); - } -} -function get_root_for_style(node) { - if (!node) - return document; - const root = node.getRootNode ? node.getRootNode() : node.ownerDocument; - if (root && root.host) { - return root; - } - return node.ownerDocument; -} -function append_empty_stylesheet(node) { - const style_element = element("style"); - append_stylesheet(get_root_for_style(node), style_element); - return style_element.sheet; -} -function append_stylesheet(node, style) { - append(node.head || node, style); -} -function insert(target, node, anchor) { - target.insertBefore(node, anchor || null); -} -function detach(node) { - node.parentNode.removeChild(node); -} -function destroy_each(iterations, detaching) { - for (let i = 0; i < iterations.length; i += 1) { - if (iterations[i]) - iterations[i].d(detaching); - } -} -function element(name) { - return document.createElement(name); -} -function text(data) { - return document.createTextNode(data); -} -function space() { - return text(" "); -} -function empty() { - return text(""); -} -function listen(node, event, handler, options) { - node.addEventListener(event, handler, options); - return () => node.removeEventListener(event, handler, options); -} -function attr(node, attribute, value) { - if (value == null) - node.removeAttribute(attribute); - else if (node.getAttribute(attribute) !== value) - node.setAttribute(attribute, value); -} -function children(element2) { - return Array.from(element2.childNodes); -} -function set_data(text2, data) { - data = "" + data; - if (text2.wholeText !== data) - text2.data = data; -} -function set_input_value(input, value) { - input.value = value == null ? "" : value; -} -function toggle_class(element2, name, toggle) { - element2.classList[toggle ? "add" : "remove"](name); -} -function custom_event(type, detail, bubbles = false) { - const e = document.createEvent("CustomEvent"); - e.initCustomEvent(type, bubbles, false, detail); - return e; -} -var managed_styles = new Map(); -var active = 0; -function hash(str) { - let hash2 = 5381; - let i = str.length; - while (i--) - hash2 = (hash2 << 5) - hash2 ^ str.charCodeAt(i); - return hash2 >>> 0; -} -function create_style_information(doc, node) { - const info = { stylesheet: append_empty_stylesheet(node), rules: {} }; - managed_styles.set(doc, info); - return info; -} -function create_rule(node, a, b, duration, delay, ease, fn, uid = 0) { - const step = 16.666 / duration; - let keyframes = "{\n"; - for (let p = 0; p <= 1; p += step) { - const t = a + (b - a) * ease(p); - keyframes += p * 100 + `%{${fn(t, 1 - t)}} -`; - } - const rule = keyframes + `100% {${fn(b, 1 - b)}} -}`; - const name = `__svelte_${hash(rule)}_${uid}`; - const doc = get_root_for_style(node); - const { stylesheet, rules } = managed_styles.get(doc) || create_style_information(doc, node); - if (!rules[name]) { - rules[name] = true; - stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length); - } - const animation = node.style.animation || ""; - node.style.animation = `${animation ? `${animation}, ` : ""}${name} ${duration}ms linear ${delay}ms 1 both`; - active += 1; - return name; -} -function delete_rule(node, name) { - const previous = (node.style.animation || "").split(", "); - const next = previous.filter(name ? (anim) => anim.indexOf(name) < 0 : (anim) => anim.indexOf("__svelte") === -1); - const deleted = previous.length - next.length; - if (deleted) { - node.style.animation = next.join(", "); - active -= deleted; - if (!active) - clear_rules(); - } -} -function clear_rules() { - raf(() => { - if (active) - return; - managed_styles.forEach((info) => { - const { stylesheet } = info; - let i = stylesheet.cssRules.length; - while (i--) - stylesheet.deleteRule(i); - info.rules = {}; - }); - managed_styles.clear(); - }); -} -var current_component; -function set_current_component(component) { - current_component = component; -} -function get_current_component() { - if (!current_component) - throw new Error("Function called outside component initialization"); - return current_component; -} -function onDestroy(fn) { - get_current_component().$$.on_destroy.push(fn); -} -function bubble(component, event) { - const callbacks = component.$$.callbacks[event.type]; - if (callbacks) { - callbacks.slice().forEach((fn) => fn.call(this, event)); - } -} -var dirty_components = []; -var binding_callbacks = []; -var render_callbacks = []; -var flush_callbacks = []; -var resolved_promise = Promise.resolve(); -var update_scheduled = false; -function schedule_update() { - if (!update_scheduled) { - update_scheduled = true; - resolved_promise.then(flush); - } -} -function add_render_callback(fn) { - render_callbacks.push(fn); -} -var seen_callbacks = new Set(); -var flushidx = 0; -function flush() { - const saved_component = current_component; - do { - while (flushidx < dirty_components.length) { - const component = dirty_components[flushidx]; - flushidx++; - set_current_component(component); - update(component.$$); - } - set_current_component(null); - dirty_components.length = 0; - flushidx = 0; - while (binding_callbacks.length) - binding_callbacks.pop()(); - for (let i = 0; i < render_callbacks.length; i += 1) { - const callback = render_callbacks[i]; - if (!seen_callbacks.has(callback)) { - seen_callbacks.add(callback); - callback(); - } - } - render_callbacks.length = 0; - } while (dirty_components.length); - while (flush_callbacks.length) { - flush_callbacks.pop()(); - } - update_scheduled = false; - seen_callbacks.clear(); - set_current_component(saved_component); -} -function update($$) { - if ($$.fragment !== null) { - $$.update(); - run_all($$.before_update); - const dirty = $$.dirty; - $$.dirty = [-1]; - $$.fragment && $$.fragment.p($$.ctx, dirty); - $$.after_update.forEach(add_render_callback); - } -} -var promise; -function wait2() { - if (!promise) { - promise = Promise.resolve(); - promise.then(() => { - promise = null; - }); - } - return promise; -} -function dispatch(node, direction, kind) { - node.dispatchEvent(custom_event(`${direction ? "intro" : "outro"}${kind}`)); -} -var outroing = new Set(); -var outros; -function group_outros() { - outros = { - r: 0, - c: [], - p: outros - }; -} -function check_outros() { - if (!outros.r) { - run_all(outros.c); - } - outros = outros.p; -} -function transition_in(block, local) { - if (block && block.i) { - outroing.delete(block); - block.i(local); - } -} -function transition_out(block, local, detach2, callback) { - if (block && block.o) { - if (outroing.has(block)) - return; - outroing.add(block); - outros.c.push(() => { - outroing.delete(block); - if (callback) { - if (detach2) - block.d(1); - callback(); - } - }); - block.o(local); - } -} -var null_transition = { duration: 0 }; -function create_bidirectional_transition(node, fn, params, intro) { - let config = fn(node, params); - let t = intro ? 0 : 1; - let running_program = null; - let pending_program = null; - let animation_name = null; - function clear_animation() { - if (animation_name) - delete_rule(node, animation_name); - } - function init2(program, duration) { - const d = program.b - t; - duration *= Math.abs(d); - return { - a: t, - b: program.b, - d, - duration, - start: program.start, - end: program.start + duration, - group: program.group - }; - } - function go(b) { - const { delay = 0, duration = 300, easing = identity, tick: tick2 = noop, css } = config || null_transition; - const program = { - start: now() + delay, - b - }; - if (!b) { - program.group = outros; - outros.r += 1; - } - if (running_program || pending_program) { - pending_program = program; - } else { - if (css) { - clear_animation(); - animation_name = create_rule(node, t, b, duration, delay, easing, css); - } - if (b) - tick2(0, 1); - running_program = init2(program, duration); - add_render_callback(() => dispatch(node, b, "start")); - loop((now2) => { - if (pending_program && now2 > pending_program.start) { - running_program = init2(pending_program, duration); - pending_program = null; - dispatch(node, running_program.b, "start"); - if (css) { - clear_animation(); - animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css); - } - } - if (running_program) { - if (now2 >= running_program.end) { - tick2(t = running_program.b, 1 - t); - dispatch(node, running_program.b, "end"); - if (!pending_program) { - if (running_program.b) { - clear_animation(); - } else { - if (!--running_program.group.r) - run_all(running_program.group.c); - } - } - running_program = null; - } else if (now2 >= running_program.start) { - const p = now2 - running_program.start; - t = running_program.a + running_program.d * easing(p / running_program.duration); - tick2(t, 1 - t); - } - } - return !!(running_program || pending_program); - }); - } - } - return { - run(b) { - if (is_function(config)) { - wait2().then(() => { - config = config(); - go(b); - }); - } else { - go(b); - } - }, - end() { - clear_animation(); - running_program = pending_program = null; - } - }; -} -var globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : global; -var boolean_attributes = new Set([ - "allowfullscreen", - "allowpaymentrequest", - "async", - "autofocus", - "autoplay", - "checked", - "controls", - "default", - "defer", - "disabled", - "formnovalidate", - "hidden", - "ismap", - "loop", - "multiple", - "muted", - "nomodule", - "novalidate", - "open", - "playsinline", - "readonly", - "required", - "reversed", - "selected" -]); -function create_component(block) { - block && block.c(); -} -function mount_component(component, target, anchor, customElement) { - const { fragment, on_mount, on_destroy, after_update } = component.$$; - fragment && fragment.m(target, anchor); - if (!customElement) { - add_render_callback(() => { - const new_on_destroy = on_mount.map(run).filter(is_function); - if (on_destroy) { - on_destroy.push(...new_on_destroy); - } else { - run_all(new_on_destroy); - } - component.$$.on_mount = []; - }); - } - after_update.forEach(add_render_callback); -} -function destroy_component(component, detaching) { - const $$ = component.$$; - if ($$.fragment !== null) { - run_all($$.on_destroy); - $$.fragment && $$.fragment.d(detaching); - $$.on_destroy = $$.fragment = null; - $$.ctx = []; - } -} -function make_dirty(component, i) { - if (component.$$.dirty[0] === -1) { - dirty_components.push(component); - schedule_update(); - component.$$.dirty.fill(0); - } - component.$$.dirty[i / 31 | 0] |= 1 << i % 31; -} -function init(component, options, instance5, create_fragment5, not_equal, props, append_styles2, dirty = [-1]) { - const parent_component = current_component; - set_current_component(component); - const $$ = component.$$ = { - fragment: null, - ctx: null, - props, - update: noop, - not_equal, - bound: blank_object(), - on_mount: [], - on_destroy: [], - on_disconnect: [], - before_update: [], - after_update: [], - context: new Map(options.context || (parent_component ? parent_component.$$.context : [])), - callbacks: blank_object(), - dirty, - skip_bound: false, - root: options.target || parent_component.$$.root - }; - append_styles2 && append_styles2($$.root); - let ready2 = false; - $$.ctx = instance5 ? instance5(component, options.props || {}, (i, ret, ...rest) => { - const value = rest.length ? rest[0] : ret; - if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { - if (!$$.skip_bound && $$.bound[i]) - $$.bound[i](value); - if (ready2) - make_dirty(component, i); - } - return ret; - }) : []; - $$.update(); - ready2 = true; - run_all($$.before_update); - $$.fragment = create_fragment5 ? create_fragment5($$.ctx) : false; - if (options.target) { - if (options.hydrate) { - start_hydrating(); - const nodes = children(options.target); - $$.fragment && $$.fragment.l(nodes); - nodes.forEach(detach); - } else { - $$.fragment && $$.fragment.c(); - } - if (options.intro) - transition_in(component.$$.fragment); - mount_component(component, options.target, options.anchor, options.customElement); - end_hydrating(); - flush(); - } - set_current_component(parent_component); -} -var SvelteElement; -if (typeof HTMLElement === "function") { - SvelteElement = class extends HTMLElement { - constructor() { - super(); - this.attachShadow({ mode: "open" }); - } - connectedCallback() { - const { on_mount } = this.$$; - this.$$.on_disconnect = on_mount.map(run).filter(is_function); - for (const key2 in this.$$.slotted) { - this.appendChild(this.$$.slotted[key2]); - } - } - attributeChangedCallback(attr2, _oldValue, newValue) { - this[attr2] = newValue; - } - disconnectedCallback() { - run_all(this.$$.on_disconnect); - } - $destroy() { - destroy_component(this, 1); - this.$destroy = noop; - } - $on(type, callback) { - const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []); - callbacks.push(callback); - return () => { - const index = callbacks.indexOf(callback); - if (index !== -1) - callbacks.splice(index, 1); - }; - } - $set($$props) { - if (this.$$set && !is_empty($$props)) { - this.$$.skip_bound = true; - this.$$set($$props); - this.$$.skip_bound = false; - } - } - }; -} -var SvelteComponent = class { - $destroy() { - destroy_component(this, 1); - this.$destroy = noop; - } - $on(type, callback) { - const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []); - callbacks.push(callback); - return () => { - const index = callbacks.indexOf(callback); - if (index !== -1) - callbacks.splice(index, 1); - }; - } - $set($$props) { - if (this.$$set && !is_empty($$props)) { - this.$$.skip_bound = true; - this.$$set($$props); - this.$$.skip_bound = false; - } - } -}; - -// node_modules/tslib/modules/index.js -var import_tslib = __toModule(require_tslib()); -var { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __exportStar, - __createBinding, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet -} = import_tslib.default; - -// src/ui/sidebar/gitView.svelte -var import_obsidian12 = __toModule(require("obsidian")); - -// node_modules/svelte/easing/index.mjs -function cubicOut(t) { - const f = t - 1; - return f * f * f + 1; -} - -// node_modules/svelte/transition/index.mjs -function slide(node, { delay = 0, duration = 400, easing = cubicOut } = {}) { - const style = getComputedStyle(node); - const opacity = +style.opacity; - const height = parseFloat(style.height); - const padding_top = parseFloat(style.paddingTop); - const padding_bottom = parseFloat(style.paddingBottom); - const margin_top = parseFloat(style.marginTop); - const margin_bottom = parseFloat(style.marginBottom); - const border_top_width = parseFloat(style.borderTopWidth); - const border_bottom_width = parseFloat(style.borderBottomWidth); - return { - delay, - duration, - easing, - css: (t) => `overflow: hidden;opacity: ${Math.min(t * 20, 1) * opacity};height: ${t * height}px;padding-top: ${t * padding_top}px;padding-bottom: ${t * padding_bottom}px;margin-top: ${t * margin_top}px;margin-bottom: ${t * margin_bottom}px;border-top-width: ${t * border_top_width}px;border-bottom-width: ${t * border_bottom_width}px;` - }; -} - -// src/ui/sidebar/components/fileComponent.svelte -var import_obsidian10 = __toModule(require("obsidian")); - -// src/ui/modals/discardModal.ts -var import_obsidian9 = __toModule(require("obsidian")); -var DiscardModal = class extends import_obsidian9.Modal { - constructor(app, deletion, filename) { - super(app); - this.deletion = deletion; - this.filename = filename; - this.resolve = null; - } - myOpen() { - this.open(); - return new Promise((resolve) => { - this.resolve = resolve; - }); - } - onOpen() { - let { contentEl, titleEl } = this; - titleEl.setText(`${this.deletion ? "Delete" : "Discard"} this file?`); - contentEl.createEl("h4").setText(`Do you really want to ${this.deletion ? "delete" : "discard the changes of"} "${this.filename}"`); - const div = contentEl.createDiv(); - div.addClass("obsidian-git-center"); - div.createEl("button", { text: "Cancel" }).addEventListener("click", () => { - if (this.resolve) - this.resolve(false); - return this.close(); - }); - div.createEl("button", { - cls: "mod-cta", - text: "Confirm" - }).addEventListener("click", () => __async(this, null, function* () { - if (this.resolve) - this.resolve(true); - this.close(); - })); - } - onClose() { - let { contentEl } = this; - contentEl.empty(); - } -}; - -// src/ui/sidebar/components/fileComponent.svelte -function add_css(target) { - append_styles(target, "svelte-1ncg2cs", "main.svelte-1ncg2cs.svelte-1ncg2cs.svelte-1ncg2cs{background-color:var(--background-secondary);border-radius:4px;width:98%;display:flex;justify-content:space-between;font-size:0.8rem;margin-bottom:2px}main.svelte-1ncg2cs .path.svelte-1ncg2cs.svelte-1ncg2cs{color:var(--text-muted);white-space:nowrap;max-width:75%;overflow:hidden;text-overflow:ellipsis}main.svelte-1ncg2cs .path.svelte-1ncg2cs.svelte-1ncg2cs:hover{color:var(--text-normal);transition:all 200ms}main.svelte-1ncg2cs .tools.svelte-1ncg2cs.svelte-1ncg2cs{display:flex;align-items:center}main.svelte-1ncg2cs .tools .type.svelte-1ncg2cs.svelte-1ncg2cs{height:16px;width:16px;margin:0;display:flex;align-items:center;justify-content:center}main.svelte-1ncg2cs .tools .type[data-type=M].svelte-1ncg2cs.svelte-1ncg2cs{color:orange}main.svelte-1ncg2cs .tools .type[data-type=D].svelte-1ncg2cs.svelte-1ncg2cs{color:red}main.svelte-1ncg2cs .tools .buttons.svelte-1ncg2cs.svelte-1ncg2cs{display:flex}main.svelte-1ncg2cs .tools .buttons.svelte-1ncg2cs>.svelte-1ncg2cs{color:var(--text-faint);height:16px;width:16px;margin:0;transition:all 0.2s;border-radius:2px;margin-right:1px}main.svelte-1ncg2cs .tools .buttons.svelte-1ncg2cs>.svelte-1ncg2cs:hover{color:var(--text-normal);background-color:var(--interactive-accent)}"); -} -function create_fragment(ctx) { - let main; - let span0; - let t0_value = ctx[0].path.split("/").last().replace(".md", "") + ""; - let t0; - let span0_aria_label_value; - let t1; - let div3; - let div2; - let div0; - let t2; - let div1; - let t3; - let span1; - let t4_value = ctx[0].working_dir + ""; - let t4; - let span1_data_type_value; - let mounted; - let dispose; - return { - c() { - main = element("main"); - span0 = element("span"); - t0 = text(t0_value); - t1 = space(); - div3 = element("div"); - div2 = element("div"); - div0 = element("div"); - t2 = space(); - div1 = element("div"); - t3 = space(); - span1 = element("span"); - t4 = text(t4_value); - attr(span0, "class", "path svelte-1ncg2cs"); - attr(span0, "aria-label-position", ctx[2]); - attr(span0, "aria-label", span0_aria_label_value = ctx[0].path.split("/").last() != ctx[0].path ? ctx[0].path : ""); - attr(div0, "data-icon", "feather-skip-back"); - attr(div0, "aria-label", "Discard"); - attr(div0, "class", "svelte-1ncg2cs"); - attr(div1, "data-icon", "feather-plus"); - attr(div1, "aria-label", "Stage"); - attr(div1, "class", "svelte-1ncg2cs"); - attr(div2, "class", "buttons svelte-1ncg2cs"); - attr(span1, "class", "type svelte-1ncg2cs"); - attr(span1, "data-type", span1_data_type_value = ctx[0].working_dir); - attr(div3, "class", "tools svelte-1ncg2cs"); - attr(main, "class", "svelte-1ncg2cs"); - }, - m(target, anchor) { - insert(target, main, anchor); - append(main, span0); - append(span0, t0); - append(main, t1); - append(main, div3); - append(div3, div2); - append(div2, div0); - ctx[12](div0); - append(div2, t2); - append(div2, div1); - ctx[13](div1); - append(div3, t3); - append(div3, span1); - append(span1, t4); - if (!mounted) { - dispose = [ - listen(span0, "mouseover", ctx[3]), - listen(span0, "click", ctx[4]), - listen(span0, "dblclick", ctx[6]), - listen(span0, "focus", ctx[11]), - listen(div0, "click", ctx[7]), - listen(div1, "click", ctx[5]) - ]; - mounted = true; - } - }, - p(ctx2, [dirty]) { - if (dirty & 1 && t0_value !== (t0_value = ctx2[0].path.split("/").last().replace(".md", "") + "")) - set_data(t0, t0_value); - if (dirty & 4) { - attr(span0, "aria-label-position", ctx2[2]); - } - if (dirty & 1 && span0_aria_label_value !== (span0_aria_label_value = ctx2[0].path.split("/").last() != ctx2[0].path ? ctx2[0].path : "")) { - attr(span0, "aria-label", span0_aria_label_value); - } - if (dirty & 1 && t4_value !== (t4_value = ctx2[0].working_dir + "")) - set_data(t4, t4_value); - if (dirty & 1 && span1_data_type_value !== (span1_data_type_value = ctx2[0].working_dir)) { - attr(span1, "data-type", span1_data_type_value); - } - }, - i: noop, - o: noop, - d(detaching) { - if (detaching) - detach(main); - ctx[12](null); - ctx[13](null); - mounted = false; - run_all(dispose); - } - }; -} -function instance($$self, $$props, $$invalidate) { - let side; - let { change } = $$props; - let { view } = $$props; - let { manager } = $$props; - let { workspace } = $$props; - let buttons = []; - setImmediate(() => buttons.forEach((b) => (0, import_obsidian10.setIcon)(b, b.getAttr("data-icon"), 16))); - function hover(event) { - if (!change.path.startsWith(view.app.vault.configDir) || !change.path.startsWith(".")) { - hoverPreview(event, view, change.path.split("/").last().replace(".md", "")); - } - } - function open(event) { - if (!(change.path.startsWith(view.app.vault.configDir) || change.path.startsWith(".") || change.working_dir === "D")) { - openOrSwitch(view.app, change.path, event); - } - } - function stage() { - manager.stage(change.path).then(() => { - dispatchEvent(new CustomEvent("git-refresh")); - }); - } - function showDiff() { - workspace.createLeafInParent(workspace.rootSplit, 0).setViewState({ type: DIFF_VIEW_CONFIG.type }); - dispatchEvent(new CustomEvent("diff-update", { detail: { path: change.path } })); - } - function discard() { - const deleteFile = change.working_dir == "U"; - new DiscardModal(view.app, deleteFile, change.path).myOpen().then((shouldDiscard) => { - if (shouldDiscard === true) { - if (deleteFile) { - view.app.vault.adapter.remove(change.path).then(() => { - dispatchEvent(new CustomEvent("git-refresh")); - }); - } else { - manager.discard(change.path).then(() => { - dispatchEvent(new CustomEvent("git-refresh")); - }); - } - } - }); - } - function focus_handler(event) { - bubble.call(this, $$self, event); - } - function div0_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[0] = $$value; - $$invalidate(1, buttons); - }); - } - function div1_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[2] = $$value; - $$invalidate(1, buttons); - }); - } - $$self.$$set = ($$props2) => { - if ("change" in $$props2) - $$invalidate(0, change = $$props2.change); - if ("view" in $$props2) - $$invalidate(8, view = $$props2.view); - if ("manager" in $$props2) - $$invalidate(9, manager = $$props2.manager); - if ("workspace" in $$props2) - $$invalidate(10, workspace = $$props2.workspace); - }; - $$self.$$.update = () => { - if ($$self.$$.dirty & 256) { - $: - $$invalidate(2, side = view.leaf.getRoot().side == "left" ? "right" : "left"); - } - }; - return [ - change, - buttons, - side, - hover, - open, - stage, - showDiff, - discard, - view, - manager, - workspace, - focus_handler, - div0_binding, - div1_binding - ]; -} -var FileComponent = class extends SvelteComponent { - constructor(options) { - super(); - init(this, options, instance, create_fragment, safe_not_equal, { - change: 0, - view: 8, - manager: 9, - workspace: 10 - }, add_css); - } -}; -var fileComponent_default = FileComponent; - -// src/ui/sidebar/components/stagedFileComponent.svelte -var import_obsidian11 = __toModule(require("obsidian")); -function add_css2(target) { - append_styles(target, "svelte-1m5vxuz", "main.svelte-1m5vxuz.svelte-1m5vxuz.svelte-1m5vxuz{background-color:var(--background-secondary);border-radius:4px;width:98%;display:flex;justify-content:space-between;font-size:0.8rem;margin-bottom:2px}main.svelte-1m5vxuz .path.svelte-1m5vxuz.svelte-1m5vxuz{color:var(--text-muted);white-space:nowrap;max-width:75%;overflow:hidden;text-overflow:ellipsis}main.svelte-1m5vxuz .path.svelte-1m5vxuz.svelte-1m5vxuz:hover{color:var(--text-normal);transition:all 200ms}main.svelte-1m5vxuz .tools.svelte-1m5vxuz.svelte-1m5vxuz{display:flex;align-items:center}main.svelte-1m5vxuz .tools .type.svelte-1m5vxuz.svelte-1m5vxuz{height:16px;width:16px;margin:0;display:flex;align-items:center;justify-content:center}main.svelte-1m5vxuz .tools .type[data-type=M].svelte-1m5vxuz.svelte-1m5vxuz{color:orange}main.svelte-1m5vxuz .tools .type[data-type=D].svelte-1m5vxuz.svelte-1m5vxuz{color:red}main.svelte-1m5vxuz .tools .type[data-type=A].svelte-1m5vxuz.svelte-1m5vxuz{color:yellowgreen}main.svelte-1m5vxuz .tools .type[data-type=R].svelte-1m5vxuz.svelte-1m5vxuz{color:violet}main.svelte-1m5vxuz .tools .buttons.svelte-1m5vxuz.svelte-1m5vxuz{display:flex}main.svelte-1m5vxuz .tools .buttons.svelte-1m5vxuz>.svelte-1m5vxuz{color:var(--text-faint);height:16px;width:16px;margin:0;transition:all 0.2s;border-radius:2px;margin-right:1px}main.svelte-1m5vxuz .tools .buttons.svelte-1m5vxuz>.svelte-1m5vxuz:hover{color:var(--text-normal);background-color:var(--interactive-accent)}"); -} -function create_fragment2(ctx) { - let main; - let span0; - let t0_value = ctx[2].split("/").last().replace(".md", "") + ""; - let t0; - let span0_aria_label_value; - let t1; - let div2; - let div1; - let div0; - let t2; - let span1; - let t3_value = ctx[0].index + ""; - let t3; - let span1_data_type_value; - let mounted; - let dispose; - return { - c() { - main = element("main"); - span0 = element("span"); - t0 = text(t0_value); - t1 = space(); - div2 = element("div"); - div1 = element("div"); - div0 = element("div"); - t2 = space(); - span1 = element("span"); - t3 = text(t3_value); - attr(span0, "class", "path svelte-1m5vxuz"); - attr(span0, "aria-label-position", ctx[3]); - attr(span0, "aria-label", span0_aria_label_value = ctx[0].path.split("/").last() != ctx[0].path ? ctx[0].path : ""); - attr(div0, "data-icon", "feather-minus"); - attr(div0, "aria-label", "Unstage"); - attr(div0, "class", "svelte-1m5vxuz"); - attr(div1, "class", "buttons svelte-1m5vxuz"); - attr(span1, "class", "type svelte-1m5vxuz"); - attr(span1, "data-type", span1_data_type_value = ctx[0].index); - attr(div2, "class", "tools svelte-1m5vxuz"); - attr(main, "class", "svelte-1m5vxuz"); - }, - m(target, anchor) { - insert(target, main, anchor); - append(main, span0); - append(span0, t0); - append(main, t1); - append(main, div2); - append(div2, div1); - append(div1, div0); - ctx[10](div0); - append(div2, t2); - append(div2, span1); - append(span1, t3); - if (!mounted) { - dispose = [ - listen(span0, "mouseover", ctx[4]), - listen(span0, "focus", ctx[9]), - listen(span0, "click", ctx[5]), - listen(div0, "click", ctx[6]) - ]; - mounted = true; - } - }, - p(ctx2, [dirty]) { - if (dirty & 4 && t0_value !== (t0_value = ctx2[2].split("/").last().replace(".md", "") + "")) - set_data(t0, t0_value); - if (dirty & 8) { - attr(span0, "aria-label-position", ctx2[3]); - } - if (dirty & 1 && span0_aria_label_value !== (span0_aria_label_value = ctx2[0].path.split("/").last() != ctx2[0].path ? ctx2[0].path : "")) { - attr(span0, "aria-label", span0_aria_label_value); - } - if (dirty & 1 && t3_value !== (t3_value = ctx2[0].index + "")) - set_data(t3, t3_value); - if (dirty & 1 && span1_data_type_value !== (span1_data_type_value = ctx2[0].index)) { - attr(span1, "data-type", span1_data_type_value); - } - }, - i: noop, - o: noop, - d(detaching) { - if (detaching) - detach(main); - ctx[10](null); - mounted = false; - run_all(dispose); - } - }; -} -function instance2($$self, $$props, $$invalidate) { - let formattedPath; - let side; - let { change } = $$props; - let { view } = $$props; - let { manager } = $$props; - let buttons = []; - setImmediate(() => buttons.forEach((b) => (0, import_obsidian11.setIcon)(b, b.getAttr("data-icon"), 16))); - function hover(event) { - if (!change.path.startsWith(view.app.vault.configDir) || !change.path.startsWith(".")) { - hoverPreview(event, view, formattedPath.split("/").last().replace(".md", "")); - } - } - function open(event) { - if (!(change.path.startsWith(view.app.vault.configDir) || change.path.startsWith(".") || change.index === "D")) { - openOrSwitch(view.app, formattedPath, event); - } - } - function unstage() { - manager.unstage(formattedPath).then(() => { - dispatchEvent(new CustomEvent("git-refresh")); - }); - } - function focus_handler(event) { - bubble.call(this, $$self, event); - } - function div0_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[0] = $$value; - $$invalidate(1, buttons); - }); - } - $$self.$$set = ($$props2) => { - if ("change" in $$props2) - $$invalidate(0, change = $$props2.change); - if ("view" in $$props2) - $$invalidate(7, view = $$props2.view); - if ("manager" in $$props2) - $$invalidate(8, manager = $$props2.manager); - }; - $$self.$$.update = () => { - if ($$self.$$.dirty & 1) { - $: - $$invalidate(2, formattedPath = change.path); - } - if ($$self.$$.dirty & 128) { - $: - $$invalidate(3, side = view.leaf.getRoot().side == "left" ? "right" : "left"); - } - }; - return [ - change, - buttons, - formattedPath, - side, - hover, - open, - unstage, - view, - manager, - focus_handler, - div0_binding - ]; -} -var StagedFileComponent = class extends SvelteComponent { - constructor(options) { - super(); - init(this, options, instance2, create_fragment2, safe_not_equal, { change: 0, view: 7, manager: 8 }, add_css2); - } -}; -var stagedFileComponent_default = StagedFileComponent; - -// src/ui/sidebar/components/treeComponent.svelte -function add_css3(target) { - append_styles(target, "svelte-pgmdei", '@charset "UTF-8";main.svelte-pgmdei.svelte-pgmdei:not(.topLevel){margin-left:5px}.opener.svelte-pgmdei.svelte-pgmdei{display:flex;justify-content:space-between;align-items:center;padding:0 4px}.opener.svelte-pgmdei .collapse-icon.svelte-pgmdei::after{content:"\xA0"}.opener.svelte-pgmdei div.svelte-pgmdei{display:flex}.opener.svelte-pgmdei svg.svelte-pgmdei{transform:rotate(-90deg)}.opener.open.svelte-pgmdei svg.svelte-pgmdei{transform:rotate(0)}.opener.svelte-pgmdei span.svelte-pgmdei{font-size:0.8rem}.file-view.svelte-pgmdei.svelte-pgmdei{margin-left:5px}'); -} -function get_each_context(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[7] = list[i]; - return child_ctx; -} -function create_else_block_1(ctx) { - let div2; - let div1; - let div0; - let t0; - let span; - let t1_value = ctx[7].title + ""; - let t1; - let t2; - let if_block_anchor; - let current; - let mounted; - let dispose; - function click_handler() { - return ctx[6](ctx[7]); - } - let if_block = !ctx[5][ctx[7].title] && create_if_block_2(ctx); - return { - c() { - div2 = element("div"); - div1 = element("div"); - div0 = element("div"); - div0.innerHTML = ``; - t0 = space(); - span = element("span"); - t1 = text(t1_value); - t2 = space(); - if (if_block) - if_block.c(); - if_block_anchor = empty(); - attr(div0, "class", "tree-item-icon collapse-icon svelte-pgmdei"); - attr(div0, "style", ""); - attr(span, "class", "svelte-pgmdei"); - attr(div1, "class", "svelte-pgmdei"); - attr(div2, "class", "opener tree-item-self is-clickable svelte-pgmdei"); - toggle_class(div2, "open", !ctx[5][ctx[7].title]); - }, - m(target, anchor) { - insert(target, div2, anchor); - append(div2, div1); - append(div1, div0); - append(div1, t0); - append(div1, span); - append(span, t1); - insert(target, t2, anchor); - if (if_block) - if_block.m(target, anchor); - insert(target, if_block_anchor, anchor); - current = true; - if (!mounted) { - dispose = listen(div2, "click", click_handler); - mounted = true; - } - }, - p(new_ctx, dirty) { - ctx = new_ctx; - if ((!current || dirty & 1) && t1_value !== (t1_value = ctx[7].title + "")) - set_data(t1, t1_value); - if (dirty & 33) { - toggle_class(div2, "open", !ctx[5][ctx[7].title]); - } - if (!ctx[5][ctx[7].title]) { - if (if_block) { - if_block.p(ctx, dirty); - if (dirty & 33) { - transition_in(if_block, 1); - } - } else { - if_block = create_if_block_2(ctx); - if_block.c(); - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - } else if (if_block) { - group_outros(); - transition_out(if_block, 1, 1, () => { - if_block = null; - }); - check_outros(); - } - }, - i(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o(local) { - transition_out(if_block); - current = false; - }, - d(detaching) { - if (detaching) - detach(div2); - if (detaching) - detach(t2); - if (if_block) - if_block.d(detaching); - if (detaching) - detach(if_block_anchor); - mounted = false; - dispose(); - } - }; -} -function create_if_block(ctx) { - let div; - let current_block_type_index; - let if_block; - let t; - let current; - const if_block_creators = [create_if_block_1, create_else_block]; - const if_blocks = []; - function select_block_type_1(ctx2, dirty) { - if (ctx2[3]) - return 0; - return 1; - } - current_block_type_index = select_block_type_1(ctx, -1); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - return { - c() { - div = element("div"); - if_block.c(); - t = space(); - attr(div, "class", "file-view svelte-pgmdei"); - }, - m(target, anchor) { - insert(target, div, anchor); - if_blocks[current_block_type_index].m(div, null); - append(div, t); - current = true; - }, - p(ctx2, dirty) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type_1(ctx2, dirty); - if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } else { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - if_block = if_blocks[current_block_type_index]; - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block.c(); - } else { - if_block.p(ctx2, dirty); - } - transition_in(if_block, 1); - if_block.m(div, t); - } - }, - i(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o(local) { - transition_out(if_block); - current = false; - }, - d(detaching) { - if (detaching) - detach(div); - if_blocks[current_block_type_index].d(); - } - }; -} -function create_if_block_2(ctx) { - let div; - let treecomponent; - let t; - let div_transition; - let current; - treecomponent = new TreeComponent({ - props: { - hierarchy: ctx[7], - plugin: ctx[1], - view: ctx[2], - staged: ctx[3] - } - }); - return { - c() { - div = element("div"); - create_component(treecomponent.$$.fragment); - t = space(); - attr(div, "class", "file-view svelte-pgmdei"); - }, - m(target, anchor) { - insert(target, div, anchor); - mount_component(treecomponent, div, null); - append(div, t); - current = true; - }, - p(ctx2, dirty) { - const treecomponent_changes = {}; - if (dirty & 1) - treecomponent_changes.hierarchy = ctx2[7]; - if (dirty & 2) - treecomponent_changes.plugin = ctx2[1]; - if (dirty & 4) - treecomponent_changes.view = ctx2[2]; - if (dirty & 8) - treecomponent_changes.staged = ctx2[3]; - treecomponent.$set(treecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(treecomponent.$$.fragment, local); - if (local) { - add_render_callback(() => { - if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 75 }, true); - div_transition.run(1); - }); - } - current = true; - }, - o(local) { - transition_out(treecomponent.$$.fragment, local); - if (local) { - if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 75 }, false); - div_transition.run(0); - } - current = false; - }, - d(detaching) { - if (detaching) - detach(div); - destroy_component(treecomponent); - if (detaching && div_transition) - div_transition.end(); - } - }; -} -function create_else_block(ctx) { - let filecomponent; - let current; - filecomponent = new fileComponent_default({ - props: { - change: ctx[7].statusResult, - manager: ctx[1].gitManager, - view: ctx[2], - workspace: ctx[1].app.workspace - } - }); - return { - c() { - create_component(filecomponent.$$.fragment); - }, - m(target, anchor) { - mount_component(filecomponent, target, anchor); - current = true; - }, - p(ctx2, dirty) { - const filecomponent_changes = {}; - if (dirty & 1) - filecomponent_changes.change = ctx2[7].statusResult; - if (dirty & 2) - filecomponent_changes.manager = ctx2[1].gitManager; - if (dirty & 4) - filecomponent_changes.view = ctx2[2]; - if (dirty & 2) - filecomponent_changes.workspace = ctx2[1].app.workspace; - filecomponent.$set(filecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(filecomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(filecomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(filecomponent, detaching); - } - }; -} -function create_if_block_1(ctx) { - let stagedfilecomponent; - let current; - stagedfilecomponent = new stagedFileComponent_default({ - props: { - change: ctx[7].statusResult, - manager: ctx[1].gitManager, - view: ctx[2] - } - }); - return { - c() { - create_component(stagedfilecomponent.$$.fragment); - }, - m(target, anchor) { - mount_component(stagedfilecomponent, target, anchor); - current = true; - }, - p(ctx2, dirty) { - const stagedfilecomponent_changes = {}; - if (dirty & 1) - stagedfilecomponent_changes.change = ctx2[7].statusResult; - if (dirty & 2) - stagedfilecomponent_changes.manager = ctx2[1].gitManager; - if (dirty & 4) - stagedfilecomponent_changes.view = ctx2[2]; - stagedfilecomponent.$set(stagedfilecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(stagedfilecomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(stagedfilecomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(stagedfilecomponent, detaching); - } - }; -} -function create_each_block(ctx) { - let current_block_type_index; - let if_block; - let if_block_anchor; - let current; - const if_block_creators = [create_if_block, create_else_block_1]; - const if_blocks = []; - function select_block_type(ctx2, dirty) { - if (ctx2[7].statusResult) - return 0; - return 1; - } - current_block_type_index = select_block_type(ctx, -1); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - return { - c() { - if_block.c(); - if_block_anchor = empty(); - }, - m(target, anchor) { - if_blocks[current_block_type_index].m(target, anchor); - insert(target, if_block_anchor, anchor); - current = true; - }, - p(ctx2, dirty) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type(ctx2, dirty); - if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } else { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - if_block = if_blocks[current_block_type_index]; - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block.c(); - } else { - if_block.p(ctx2, dirty); - } - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - }, - i(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o(local) { - transition_out(if_block); - current = false; - }, - d(detaching) { - if_blocks[current_block_type_index].d(detaching); - if (detaching) - detach(if_block_anchor); - } - }; -} -function create_fragment3(ctx) { - let main; - let current; - let each_value = ctx[0].children; - let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); - } - const out = (i) => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - return { - c() { - main = element("main"); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - attr(main, "class", "svelte-pgmdei"); - toggle_class(main, "topLevel", ctx[4]); - }, - m(target, anchor) { - insert(target, main, anchor); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(main, null); - } - current = true; - }, - p(ctx2, [dirty]) { - if (dirty & 47) { - each_value = ctx2[0].children; - let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context(ctx2, each_value, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(main, null); - } - } - group_outros(); - for (i = each_value.length; i < each_blocks.length; i += 1) { - out(i); - } - check_outros(); - } - if (dirty & 16) { - toggle_class(main, "topLevel", ctx2[4]); - } - }, - i(local) { - if (current) - return; - for (let i = 0; i < each_value.length; i += 1) { - transition_in(each_blocks[i]); - } - current = true; - }, - o(local) { - each_blocks = each_blocks.filter(Boolean); - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - current = false; - }, - d(detaching) { - if (detaching) - detach(main); - destroy_each(each_blocks, detaching); - } - }; -} -function instance3($$self, $$props, $$invalidate) { - let { hierarchy } = $$props; - let { plugin } = $$props; - let { view } = $$props; - let { staged } = $$props; - let { topLevel = false } = $$props; - const closed = {}; - const click_handler = (entity) => { - $$invalidate(5, closed[entity.title] = !closed[entity.title], closed); - }; - $$self.$$set = ($$props2) => { - if ("hierarchy" in $$props2) - $$invalidate(0, hierarchy = $$props2.hierarchy); - if ("plugin" in $$props2) - $$invalidate(1, plugin = $$props2.plugin); - if ("view" in $$props2) - $$invalidate(2, view = $$props2.view); - if ("staged" in $$props2) - $$invalidate(3, staged = $$props2.staged); - if ("topLevel" in $$props2) - $$invalidate(4, topLevel = $$props2.topLevel); - }; - return [hierarchy, plugin, view, staged, topLevel, closed, click_handler]; -} -var TreeComponent = class extends SvelteComponent { - constructor(options) { - super(); - init(this, options, instance3, create_fragment3, safe_not_equal, { - hierarchy: 0, - plugin: 1, - view: 2, - staged: 3, - topLevel: 4 - }, add_css3); - } -}; -var treeComponent_default = TreeComponent; - -// src/ui/sidebar/gitView.svelte -function add_css4(target) { - append_styles(target, "svelte-1f0ksxd", '@charset "UTF-8";.commit-msg.svelte-1f0ksxd.svelte-1f0ksxd{width:100%;min-height:1.9em;height:1.9em;resize:vertical;padding:2px 5px;background-color:var(--background-modifier-form-field)}.search-input-container.svelte-1f0ksxd.svelte-1f0ksxd{width:100%}.file-view.svelte-1f0ksxd.svelte-1f0ksxd{margin-left:5px}.opener.svelte-1f0ksxd.svelte-1f0ksxd{display:flex;justify-content:space-between;align-items:center;padding:0 4px}.opener.svelte-1f0ksxd .collapse-icon.svelte-1f0ksxd::after{content:"\xA0"}.opener.svelte-1f0ksxd div.svelte-1f0ksxd{display:flex}.opener.svelte-1f0ksxd svg.svelte-1f0ksxd{transform:rotate(-90deg)}.opener.open.svelte-1f0ksxd svg.svelte-1f0ksxd{transform:rotate(0)}.git-view-body.svelte-1f0ksxd.svelte-1f0ksxd{overflow-y:auto;padding-left:10px}main.svelte-1f0ksxd.svelte-1f0ksxd{display:flex;flex-direction:column;height:100%;overflow-y:hidden}.nav-buttons-container.svelte-1f0ksxd.svelte-1f0ksxd{justify-content:space-between}.group.svelte-1f0ksxd.svelte-1f0ksxd{display:flex}'); -} -function get_each_context2(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[35] = list[i]; - return child_ctx; -} -function get_each_context_1(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[38] = list[i]; - return child_ctx; -} -function create_if_block_5(ctx) { - let div; - let div_aria_label_value; - let mounted; - let dispose; - return { - c() { - div = element("div"); - attr(div, "class", "search-input-clear-button"); - attr(div, "aria-label", div_aria_label_value = "Clear"); - }, - m(target, anchor) { - insert(target, div, anchor); - if (!mounted) { - dispose = listen(div, "click", ctx[27]); - mounted = true; - } - }, - p: noop, - d(detaching) { - if (detaching) - detach(div); - mounted = false; - dispose(); - } - }; -} -function create_if_block2(ctx) { - let div3; - let div2; - let div1; - let t2; - let span1; - let t3_value = ctx[6].staged.length + ""; - let t3; - let t4; - let t5; - let div7; - let div6; - let div5; - let t8; - let span3; - let t9_value = ctx[6].changed.length + ""; - let t9; - let t10; - let current; - let mounted; - let dispose; - let if_block0 = ctx[10] && create_if_block_3(ctx); - let if_block1 = ctx[9] && create_if_block_12(ctx); - return { - c() { - div3 = element("div"); - div2 = element("div"); - div1 = element("div"); - div1.innerHTML = `
    - Staged Changes`; - t2 = space(); - span1 = element("span"); - t3 = text(t3_value); - t4 = space(); - if (if_block0) - if_block0.c(); - t5 = space(); - div7 = element("div"); - div6 = element("div"); - div5 = element("div"); - div5.innerHTML = `
    - Changes`; - t8 = space(); - span3 = element("span"); - t9 = text(t9_value); - t10 = space(); - if (if_block1) - if_block1.c(); - attr(div1, "class", "svelte-1f0ksxd"); - attr(span1, "class", "tree-item-flair"); - attr(div2, "class", "opener tree-item-self is-clickable svelte-1f0ksxd"); - toggle_class(div2, "open", ctx[10]); - attr(div3, "class", "staged"); - attr(div5, "class", "svelte-1f0ksxd"); - attr(span3, "class", "tree-item-flair"); - attr(div6, "class", "opener tree-item-self is-clickable svelte-1f0ksxd"); - toggle_class(div6, "open", ctx[9]); - attr(div7, "class", "changes"); - }, - m(target, anchor) { - insert(target, div3, anchor); - append(div3, div2); - append(div2, div1); - append(div2, t2); - append(div2, span1); - append(span1, t3); - append(div3, t4); - if (if_block0) - if_block0.m(div3, null); - insert(target, t5, anchor); - insert(target, div7, anchor); - append(div7, div6); - append(div6, div5); - append(div6, t8); - append(div6, span3); - append(span3, t9); - append(div7, t10); - if (if_block1) - if_block1.m(div7, null); - current = true; - if (!mounted) { - dispose = [ - listen(div2, "click", ctx[28]), - listen(div6, "click", ctx[29]) - ]; - mounted = true; - } - }, - p(ctx2, dirty) { - if ((!current || dirty[0] & 64) && t3_value !== (t3_value = ctx2[6].staged.length + "")) - set_data(t3, t3_value); - if (dirty[0] & 1024) { - toggle_class(div2, "open", ctx2[10]); - } - if (ctx2[10]) { - if (if_block0) { - if_block0.p(ctx2, dirty); - if (dirty[0] & 1024) { - transition_in(if_block0, 1); - } - } else { - if_block0 = create_if_block_3(ctx2); - if_block0.c(); - transition_in(if_block0, 1); - if_block0.m(div3, null); - } - } else if (if_block0) { - group_outros(); - transition_out(if_block0, 1, 1, () => { - if_block0 = null; - }); - check_outros(); - } - if ((!current || dirty[0] & 64) && t9_value !== (t9_value = ctx2[6].changed.length + "")) - set_data(t9, t9_value); - if (dirty[0] & 512) { - toggle_class(div6, "open", ctx2[9]); - } - if (ctx2[9]) { - if (if_block1) { - if_block1.p(ctx2, dirty); - if (dirty[0] & 512) { - transition_in(if_block1, 1); - } - } else { - if_block1 = create_if_block_12(ctx2); - if_block1.c(); - transition_in(if_block1, 1); - if_block1.m(div7, null); - } - } else if (if_block1) { - group_outros(); - transition_out(if_block1, 1, 1, () => { - if_block1 = null; - }); - check_outros(); - } - }, - i(local) { - if (current) - return; - transition_in(if_block0); - transition_in(if_block1); - current = true; - }, - o(local) { - transition_out(if_block0); - transition_out(if_block1); - current = false; - }, - d(detaching) { - if (detaching) - detach(div3); - if (if_block0) - if_block0.d(); - if (detaching) - detach(t5); - if (detaching) - detach(div7); - if (if_block1) - if_block1.d(); - mounted = false; - run_all(dispose); - } - }; -} -function create_if_block_3(ctx) { - let div; - let current_block_type_index; - let if_block; - let div_transition; - let current; - const if_block_creators = [create_if_block_4, create_else_block_12]; - const if_blocks = []; - function select_block_type(ctx2, dirty) { - if (ctx2[2]) - return 0; - return 1; - } - current_block_type_index = select_block_type(ctx, [-1, -1]); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - return { - c() { - div = element("div"); - if_block.c(); - attr(div, "class", "file-view svelte-1f0ksxd"); - }, - m(target, anchor) { - insert(target, div, anchor); - if_blocks[current_block_type_index].m(div, null); - current = true; - }, - p(ctx2, dirty) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type(ctx2, dirty); - if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } else { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - if_block = if_blocks[current_block_type_index]; - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block.c(); - } else { - if_block.p(ctx2, dirty); - } - transition_in(if_block, 1); - if_block.m(div, null); - } - }, - i(local) { - if (current) - return; - transition_in(if_block); - if (local) { - add_render_callback(() => { - if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, true); - div_transition.run(1); - }); - } - current = true; - }, - o(local) { - transition_out(if_block); - if (local) { - if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, false); - div_transition.run(0); - } - current = false; - }, - d(detaching) { - if (detaching) - detach(div); - if_blocks[current_block_type_index].d(); - if (detaching && div_transition) - div_transition.end(); - } - }; -} -function create_else_block_12(ctx) { - let each_1_anchor; - let current; - let each_value_1 = ctx[6].staged; - let each_blocks = []; - for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i)); - } - const out = (i) => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - return { - c() { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - each_1_anchor = empty(); - }, - m(target, anchor) { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(target, anchor); - } - insert(target, each_1_anchor, anchor); - current = true; - }, - p(ctx2, dirty) { - if (dirty[0] & 67) { - each_value_1 = ctx2[6].staged; - let i; - for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_1(ctx2, each_value_1, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block_1(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); - } - } - group_outros(); - for (i = each_value_1.length; i < each_blocks.length; i += 1) { - out(i); - } - check_outros(); - } - }, - i(local) { - if (current) - return; - for (let i = 0; i < each_value_1.length; i += 1) { - transition_in(each_blocks[i]); - } - current = true; - }, - o(local) { - each_blocks = each_blocks.filter(Boolean); - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - current = false; - }, - d(detaching) { - destroy_each(each_blocks, detaching); - if (detaching) - detach(each_1_anchor); - } - }; -} -function create_if_block_4(ctx) { - let treecomponent; - let current; - treecomponent = new treeComponent_default({ - props: { - hierarchy: ctx[8], - plugin: ctx[0], - view: ctx[1], - staged: true, - topLevel: true - } - }); - return { - c() { - create_component(treecomponent.$$.fragment); - }, - m(target, anchor) { - mount_component(treecomponent, target, anchor); - current = true; - }, - p(ctx2, dirty) { - const treecomponent_changes = {}; - if (dirty[0] & 256) - treecomponent_changes.hierarchy = ctx2[8]; - if (dirty[0] & 1) - treecomponent_changes.plugin = ctx2[0]; - if (dirty[0] & 2) - treecomponent_changes.view = ctx2[1]; - treecomponent.$set(treecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(treecomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(treecomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(treecomponent, detaching); - } - }; -} -function create_each_block_1(ctx) { - let stagedfilecomponent; - let current; - stagedfilecomponent = new stagedFileComponent_default({ - props: { - change: ctx[38], - view: ctx[1], - manager: ctx[0].gitManager - } - }); - return { - c() { - create_component(stagedfilecomponent.$$.fragment); - }, - m(target, anchor) { - mount_component(stagedfilecomponent, target, anchor); - current = true; - }, - p(ctx2, dirty) { - const stagedfilecomponent_changes = {}; - if (dirty[0] & 64) - stagedfilecomponent_changes.change = ctx2[38]; - if (dirty[0] & 2) - stagedfilecomponent_changes.view = ctx2[1]; - if (dirty[0] & 1) - stagedfilecomponent_changes.manager = ctx2[0].gitManager; - stagedfilecomponent.$set(stagedfilecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(stagedfilecomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(stagedfilecomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(stagedfilecomponent, detaching); - } - }; -} -function create_if_block_12(ctx) { - let div; - let current_block_type_index; - let if_block; - let div_transition; - let current; - const if_block_creators = [create_if_block_22, create_else_block2]; - const if_blocks = []; - function select_block_type_1(ctx2, dirty) { - if (ctx2[2]) - return 0; - return 1; - } - current_block_type_index = select_block_type_1(ctx, [-1, -1]); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - return { - c() { - div = element("div"); - if_block.c(); - attr(div, "class", "file-view svelte-1f0ksxd"); - }, - m(target, anchor) { - insert(target, div, anchor); - if_blocks[current_block_type_index].m(div, null); - current = true; - }, - p(ctx2, dirty) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type_1(ctx2, dirty); - if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } else { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - if_block = if_blocks[current_block_type_index]; - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block.c(); - } else { - if_block.p(ctx2, dirty); - } - transition_in(if_block, 1); - if_block.m(div, null); - } - }, - i(local) { - if (current) - return; - transition_in(if_block); - if (local) { - add_render_callback(() => { - if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, true); - div_transition.run(1); - }); - } - current = true; - }, - o(local) { - transition_out(if_block); - if (local) { - if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, false); - div_transition.run(0); - } - current = false; - }, - d(detaching) { - if (detaching) - detach(div); - if_blocks[current_block_type_index].d(); - if (detaching && div_transition) - div_transition.end(); - } - }; -} -function create_else_block2(ctx) { - let each_1_anchor; - let current; - let each_value = ctx[6].changed; - let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block2(get_each_context2(ctx, each_value, i)); - } - const out = (i) => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - return { - c() { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - each_1_anchor = empty(); - }, - m(target, anchor) { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(target, anchor); - } - insert(target, each_1_anchor, anchor); - current = true; - }, - p(ctx2, dirty) { - if (dirty[0] & 8259) { - each_value = ctx2[6].changed; - let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context2(ctx2, each_value, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block2(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); - } - } - group_outros(); - for (i = each_value.length; i < each_blocks.length; i += 1) { - out(i); - } - check_outros(); - } - }, - i(local) { - if (current) - return; - for (let i = 0; i < each_value.length; i += 1) { - transition_in(each_blocks[i]); - } - current = true; - }, - o(local) { - each_blocks = each_blocks.filter(Boolean); - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - current = false; - }, - d(detaching) { - destroy_each(each_blocks, detaching); - if (detaching) - detach(each_1_anchor); - } - }; -} -function create_if_block_22(ctx) { - let treecomponent; - let current; - treecomponent = new treeComponent_default({ - props: { - hierarchy: ctx[7], - plugin: ctx[0], - view: ctx[1], - staged: false, - topLevel: true - } - }); - return { - c() { - create_component(treecomponent.$$.fragment); - }, - m(target, anchor) { - mount_component(treecomponent, target, anchor); - current = true; - }, - p(ctx2, dirty) { - const treecomponent_changes = {}; - if (dirty[0] & 128) - treecomponent_changes.hierarchy = ctx2[7]; - if (dirty[0] & 1) - treecomponent_changes.plugin = ctx2[0]; - if (dirty[0] & 2) - treecomponent_changes.view = ctx2[1]; - treecomponent.$set(treecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(treecomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(treecomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(treecomponent, detaching); - } - }; -} -function create_each_block2(ctx) { - let filecomponent; - let current; - filecomponent = new fileComponent_default({ - props: { - change: ctx[35], - view: ctx[1], - manager: ctx[0].gitManager, - workspace: ctx[0].app.workspace - } - }); - filecomponent.$on("git-refresh", ctx[13]); - return { - c() { - create_component(filecomponent.$$.fragment); - }, - m(target, anchor) { - mount_component(filecomponent, target, anchor); - current = true; - }, - p(ctx2, dirty) { - const filecomponent_changes = {}; - if (dirty[0] & 64) - filecomponent_changes.change = ctx2[35]; - if (dirty[0] & 2) - filecomponent_changes.view = ctx2[1]; - if (dirty[0] & 1) - filecomponent_changes.manager = ctx2[0].gitManager; - if (dirty[0] & 1) - filecomponent_changes.workspace = ctx2[0].app.workspace; - filecomponent.$set(filecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(filecomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(filecomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(filecomponent, detaching); - } - }; -} -function create_fragment4(ctx) { - let main; - let div9; - let div6; - let div0; - let t0; - let div1; - let t1; - let div2; - let t2; - let div3; - let t3; - let div4; - let t4; - let div5; - let t5; - let div7; - let t6; - let div8; - let textarea; - let t7; - let t8; - let div10; - let current; - let mounted; - let dispose; - let if_block0 = ctx[4] && create_if_block_5(ctx); - let if_block1 = ctx[6] && create_if_block2(ctx); - return { - c() { - main = element("main"); - div9 = element("div"); - div6 = element("div"); - div0 = element("div"); - t0 = space(); - div1 = element("div"); - t1 = space(); - div2 = element("div"); - t2 = space(); - div3 = element("div"); - t3 = space(); - div4 = element("div"); - t4 = space(); - div5 = element("div"); - t5 = space(); - div7 = element("div"); - t6 = space(); - div8 = element("div"); - textarea = element("textarea"); - t7 = space(); - if (if_block0) - if_block0.c(); - t8 = space(); - div10 = element("div"); - if (if_block1) - if_block1.c(); - attr(div0, "id", "commit-btn"); - attr(div0, "data-icon", "feather-check"); - attr(div0, "class", "nav-action-button"); - attr(div0, "aria-label", "Commit"); - attr(div1, "id", "stage-all"); - attr(div1, "class", "nav-action-button"); - attr(div1, "data-icon", "feather-plus-circle"); - attr(div1, "aria-label", "Stage all"); - attr(div2, "id", "unstage-all"); - attr(div2, "class", "nav-action-button"); - attr(div2, "data-icon", "feather-minus-circle"); - attr(div2, "aria-label", "Unstage all"); - attr(div3, "id", "push"); - attr(div3, "class", "nav-action-button"); - attr(div3, "data-icon", "feather-upload"); - attr(div3, "aria-label", "Push"); - attr(div4, "id", "pull"); - attr(div4, "class", "nav-action-button"); - attr(div4, "data-icon", "feather-download"); - attr(div4, "aria-label", "Pull"); - attr(div5, "id", "layoutChange"); - attr(div5, "class", "nav-action-button"); - attr(div5, "aria-label", "Change Layout"); - attr(div6, "class", "group svelte-1f0ksxd"); - attr(div7, "id", "refresh"); - attr(div7, "class", "nav-action-button"); - attr(div7, "data-icon", "feather-refresh-cw"); - attr(div7, "aria-label", "Refresh"); - toggle_class(div7, "loading", ctx[11]); - attr(textarea, "class", "commit-msg svelte-1f0ksxd"); - attr(textarea, "type", "text"); - attr(textarea, "spellcheck", "true"); - attr(textarea, "placeholder", "Commit Message"); - attr(div8, "class", "search-input-container svelte-1f0ksxd"); - attr(div9, "class", "nav-buttons-container svelte-1f0ksxd"); - attr(div10, "class", "git-view-body svelte-1f0ksxd"); - attr(main, "class", "svelte-1f0ksxd"); - }, - m(target, anchor) { - insert(target, main, anchor); - append(main, div9); - append(div9, div6); - append(div6, div0); - ctx[18](div0); - append(div6, t0); - append(div6, div1); - ctx[19](div1); - append(div6, t1); - append(div6, div2); - ctx[20](div2); - append(div6, t2); - append(div6, div3); - ctx[21](div3); - append(div6, t3); - append(div6, div4); - ctx[22](div4); - append(div6, t4); - append(div6, div5); - ctx[23](div5); - append(div9, t5); - append(div9, div7); - ctx[25](div7); - append(div9, t6); - append(div9, div8); - append(div8, textarea); - set_input_value(textarea, ctx[4]); - append(div8, t7); - if (if_block0) - if_block0.m(div8, null); - append(main, t8); - append(main, div10); - if (if_block1) - if_block1.m(div10, null); - current = true; - if (!mounted) { - dispose = [ - listen(div0, "click", ctx[12]), - listen(div1, "click", ctx[14]), - listen(div2, "click", ctx[15]), - listen(div3, "click", ctx[16]), - listen(div4, "click", ctx[17]), - listen(div5, "click", ctx[24]), - listen(div7, "click", ctx[13]), - listen(textarea, "input", ctx[26]) - ]; - mounted = true; - } - }, - p(ctx2, dirty) { - if (dirty[0] & 2048) { - toggle_class(div7, "loading", ctx2[11]); - } - if (dirty[0] & 16) { - set_input_value(textarea, ctx2[4]); - } - if (ctx2[4]) { - if (if_block0) { - if_block0.p(ctx2, dirty); - } else { - if_block0 = create_if_block_5(ctx2); - if_block0.c(); - if_block0.m(div8, null); - } - } else if (if_block0) { - if_block0.d(1); - if_block0 = null; - } - if (ctx2[6]) { - if (if_block1) { - if_block1.p(ctx2, dirty); - if (dirty[0] & 64) { - transition_in(if_block1, 1); - } - } else { - if_block1 = create_if_block2(ctx2); - if_block1.c(); - transition_in(if_block1, 1); - if_block1.m(div10, null); - } - } else if (if_block1) { - group_outros(); - transition_out(if_block1, 1, 1, () => { - if_block1 = null; - }); - check_outros(); - } - }, - i(local) { - if (current) - return; - transition_in(if_block1); - current = true; - }, - o(local) { - transition_out(if_block1); - current = false; - }, - d(detaching) { - if (detaching) - detach(main); - ctx[18](null); - ctx[19](null); - ctx[20](null); - ctx[21](null); - ctx[22](null); - ctx[23](null); - ctx[25](null); - if (if_block0) - if_block0.d(); - if (if_block1) - if_block1.d(); - mounted = false; - run_all(dispose); - } - }; -} -function instance4($$self, $$props, $$invalidate) { - let { plugin } = $$props; - let { view } = $$props; - let commitMessage = plugin.settings.commitMessage; - let buttons = []; - let status; - let changeHierarchy; - let stagedHierarchy; - let changesOpen = true; - let stagedOpen = true; - let loading = true; - const debRefresh = (0, import_obsidian12.debounce)(() => { - if (plugin.settings.refreshSourceControl) { - refresh(); - } - }, 1e3); - let showTree = plugin.settings.treeStructure; - let layoutBtn; - let modifyEvent; - let deleteEvent; - let createEvent; - let renameEvent; - plugin.app.workspace.onLayoutReady(() => setImmediate(() => { - buttons.forEach((btn) => (0, import_obsidian12.setIcon)(btn, btn.getAttr("data-icon"), 16)); - (0, import_obsidian12.setIcon)(layoutBtn, showTree ? "feather-list" : "feather-folder", 16); - refresh(); - modifyEvent = plugin.app.vault.on("modify", () => { - debRefresh(); - }); - deleteEvent = plugin.app.vault.on("delete", () => { - debRefresh(); - }); - createEvent = plugin.app.vault.on("create", () => { - debRefresh(); - }); - renameEvent = plugin.app.vault.on("rename", () => { - debRefresh(); - }); - addEventListener("git-source-control-refresh", refresh); - plugin.registerEvent(modifyEvent); - plugin.registerEvent(deleteEvent); - plugin.registerEvent(createEvent); - plugin.registerEvent(renameEvent); - })); - onDestroy(() => { - plugin.app.metadataCache.offref(modifyEvent); - plugin.app.metadataCache.offref(deleteEvent); - plugin.app.metadataCache.offref(createEvent); - plugin.app.metadataCache.offref(renameEvent); - removeEventListener("git-source-control-refresh", refresh); - }); - function commit() { - $$invalidate(11, loading = true); - plugin.gitManager.commit(commitMessage).then(() => { - if (commitMessage !== plugin.settings.commitMessage) { - $$invalidate(4, commitMessage = ""); - } - refresh(); - }); - } - addEventListener("git-refresh", (_) => { - refresh(); - }); - function refresh() { - return __awaiter(this, void 0, void 0, function* () { - $$invalidate(11, loading = true); - $$invalidate(6, status = yield plugin.gitManager.status()); - $$invalidate(7, changeHierarchy = { - title: "", - children: plugin.gitManager.getTreeStructure(status.changed) - }); - $$invalidate(8, stagedHierarchy = { - title: "", - children: plugin.gitManager.getTreeStructure(status.staged) - }); - $$invalidate(11, loading = false); - }); - } - function stageAll() { - $$invalidate(11, loading = true); - plugin.gitManager.stageAll().then(() => { - refresh(); - }); - } - function unstageAll() { - $$invalidate(11, loading = true); - plugin.gitManager.unstageAll().then(() => { - refresh(); - }); - } - function push() { - $$invalidate(11, loading = true); - if (ready) { - plugin.push().then((pushedFiles) => { - refresh(); - }); - } - } - function pull() { - $$invalidate(11, loading = true); - plugin.pullChangesFromRemote().then(() => { - refresh(); - }); - } - function div0_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[0] = $$value; - $$invalidate(5, buttons); - }); - } - function div1_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[1] = $$value; - $$invalidate(5, buttons); - }); - } - function div2_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[2] = $$value; - $$invalidate(5, buttons); - }); - } - function div3_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[3] = $$value; - $$invalidate(5, buttons); - }); - } - function div4_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[4] = $$value; - $$invalidate(5, buttons); - }); - } - function div5_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - layoutBtn = $$value; - $$invalidate(3, layoutBtn); - }); - } - const click_handler = () => { - $$invalidate(2, showTree = !showTree); - $$invalidate(0, plugin.settings.treeStructure = showTree, plugin); - plugin.saveSettings(); - }; - function div7_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[6] = $$value; - $$invalidate(5, buttons); - }); - } - function textarea_input_handler() { - commitMessage = this.value; - $$invalidate(4, commitMessage); - } - const click_handler_1 = () => $$invalidate(4, commitMessage = ""); - const click_handler_2 = () => $$invalidate(10, stagedOpen = !stagedOpen); - const click_handler_3 = () => $$invalidate(9, changesOpen = !changesOpen); - $$self.$$set = ($$props2) => { - if ("plugin" in $$props2) - $$invalidate(0, plugin = $$props2.plugin); - if ("view" in $$props2) - $$invalidate(1, view = $$props2.view); - }; - $$self.$$.update = () => { - if ($$self.$$.dirty[0] & 12) { - $: { - if (layoutBtn) { - layoutBtn.empty(); - (0, import_obsidian12.setIcon)(layoutBtn, showTree ? "feather-list" : "feather-folder", 16); - } - } - } - }; - return [ - plugin, - view, - showTree, - layoutBtn, - commitMessage, - buttons, - status, - changeHierarchy, - stagedHierarchy, - changesOpen, - stagedOpen, - loading, - commit, - refresh, - stageAll, - unstageAll, - push, - pull, - div0_binding, - div1_binding, - div2_binding, - div3_binding, - div4_binding, - div5_binding, - click_handler, - div7_binding, - textarea_input_handler, - click_handler_1, - click_handler_2, - click_handler_3 - ]; -} -var GitView = class extends SvelteComponent { - constructor(options) { - super(); - init(this, options, instance4, create_fragment4, safe_not_equal, { plugin: 0, view: 1 }, add_css4, [-1, -1]); - } -}; -var gitView_default = GitView; - -// src/ui/sidebar/sidebarView.ts -var GitView2 = class extends import_obsidian13.ItemView { - constructor(leaf, plugin) { - super(leaf); - this.plugin = plugin; - this.hoverPopover = null; - } - getViewType() { - return GIT_VIEW_CONFIG.type; - } - getDisplayText() { - return GIT_VIEW_CONFIG.name; - } - getIcon() { - return GIT_VIEW_CONFIG.icon; - } - onClose() { - this._view.$destroy(); - return super.onClose(); - } - onOpen() { - this._view = new gitView_default({ - target: this.contentEl, - props: { - plugin: this.plugin, - view: this - } - }); - return super.onOpen(); - } -}; - -// src/main.ts -var ObsidianGit = class extends import_obsidian14.Plugin { - constructor() { - super(...arguments); - this.gitReady = false; - this.promiseQueue = new PromiseQueue(); - this.conflictOutputFile = "conflict-files-obsidian-git.md"; - } - setState(state) { - var _a; - this.state = state; - (_a = this.statusBar) == null ? void 0 : _a.display(); - } - onload() { - return __async(this, null, function* () { - console.log("loading " + this.manifest.name + " plugin"); - yield this.loadSettings(); - this.migrateSettings(); - addIcons(); - this.registerView(GIT_VIEW_CONFIG.type, (leaf) => { - return new GitView2(leaf, this); - }); - this.registerView(DIFF_VIEW_CONFIG.type, (leaf) => { - return new DiffView(leaf, this); - }); - this.app.workspace.registerHoverLinkSource(GIT_VIEW_CONFIG.type, { - display: "Git View", - defaultMod: true - }); - this.addSettingTab(new ObsidianGitSettingsTab(this.app, this)); - this.addCommand({ - id: "open-git-view", - name: "Open source control view", - callback: () => __async(this, null, function* () { - if (this.app.workspace.getLeavesOfType(GIT_VIEW_CONFIG.type).length === 0) { - yield this.app.workspace.getRightLeaf(false).setViewState({ - type: GIT_VIEW_CONFIG.type - }); - } - this.app.workspace.revealLeaf(this.app.workspace.getLeavesOfType(GIT_VIEW_CONFIG.type).first()); - }) - }); - this.addCommand({ - id: "open-diff-view", - name: "Open diff view", - editorCallback: (editor, view) => __async(this, null, function* () { - this.app.workspace.createLeafBySplit(view.leaf).setViewState({ type: DIFF_VIEW_CONFIG.type }); - dispatchEvent(new CustomEvent("diff-update", { detail: { path: view.file.path } })); - }) - }); - this.addCommand({ - id: "view-file-on-github", - name: "Open file on GitHub", - editorCallback: (editor, { file }) => openLineInGitHub(editor, file, this.gitManager) - }); - this.addCommand({ - id: "view-history-on-github", - name: "Open file history on GitHub", - editorCallback: (_, { file }) => openHistoryInGitHub(file, this.gitManager) - }); - this.addCommand({ - id: "pull", - name: "Pull", - callback: () => this.promiseQueue.addTask(() => this.pullChangesFromRemote()) - }); - this.addCommand({ - id: "push", - name: "Create backup", - callback: () => this.promiseQueue.addTask(() => this.createBackup(false)) - }); - this.addCommand({ - id: "commit-push-specified-message", - name: "Create backup with specific message", - callback: () => this.promiseQueue.addTask(() => this.createBackup(false, true)) - }); - this.addCommand({ - id: "commit", - name: "Commit all changes", - callback: () => this.promiseQueue.addTask(() => this.commit(false)) - }); - this.addCommand({ - id: "commit-specified-message", - name: "Commit all changes with specific message", - callback: () => this.promiseQueue.addTask(() => this.commit(false, true)) - }); - this.addCommand({ - id: "push2", - name: "Push", - callback: () => this.promiseQueue.addTask(() => this.push()) - }); - this.addCommand({ - id: "edit-remotes", - name: "Edit remotes", - callback: () => __async(this, null, function* () { - return this.editRemotes(); - }) - }); - this.addCommand({ - id: "remove-remote", - name: "Remove remote", - callback: () => __async(this, null, function* () { - return this.removeRemote(); - }) - }); - this.addCommand({ - id: "init-repo", - name: "Initialize a new repo", - callback: () => __async(this, null, function* () { - return this.createNewRepo(); - }) - }); - this.addCommand({ - id: "clone-repo", - name: "Clone an existing remote repo", - callback: () => __async(this, null, function* () { - return this.cloneNewRepo(); - }) - }); - this.addCommand({ - id: "list-changed-files", - name: "List changed files", - callback: () => __async(this, null, function* () { - const status = yield this.gitManager.status(); - this.setState(PluginState.idle); - new ChangedFilesModal(this, status.changed).open(); - }) - }); - if (this.settings.showStatusBar) { - let statusBarEl = this.addStatusBarItem(); - this.statusBar = new StatusBar(statusBarEl, this); - this.registerInterval(window.setInterval(() => this.statusBar.display(), 1e3)); - } - this.app.workspace.onLayoutReady(() => this.init()); - }); - } - migrateSettings() { - if (this.settings.mergeOnPull != void 0) { - this.settings.syncMethod = this.settings.mergeOnPull ? "merge" : "rebase"; - this.settings.mergeOnPull = void 0; - return this.saveSettings(); - } - if (this.settings.autoCommitMessage === void 0) { - this.settings.autoCommitMessage = this.settings.commitMessage; - this.saveSettings(); - } - } - onunload() { - return __async(this, null, function* () { - this.app.workspace.unregisterHoverLinkSource(GIT_VIEW_CONFIG.type); - this.app.workspace.detachLeavesOfType(GIT_VIEW_CONFIG.type); - this.app.workspace.detachLeavesOfType(DIFF_VIEW_CONFIG.type); - this.clearAutoPull(); - this.clearAutoBackup(); - console.log("unloading " + this.manifest.name + " plugin"); - }); - } - loadSettings() { - return __async(this, null, function* () { - this.settings = Object.assign({}, DEFAULT_SETTINGS, yield this.loadData()); - }); - } - saveSettings() { - return __async(this, null, function* () { - yield this.saveData(this.settings); - }); - } - saveLastAuto(date, mode) { - return __async(this, null, function* () { - if (mode === "backup") { - window.localStorage.setItem(this.manifest.id + ":lastAutoBackup", date.toString()); - } else if (mode === "pull") { - window.localStorage.setItem(this.manifest.id + ":lastAutoPull", date.toString()); - } - }); - } - loadLastAuto() { - return __async(this, null, function* () { - var _a, _b; - return { - "backup": new Date((_a = window.localStorage.getItem(this.manifest.id + ":lastAutoBackup")) != null ? _a : ""), - "pull": new Date((_b = window.localStorage.getItem(this.manifest.id + ":lastAutoPull")) != null ? _b : "") - }; - }); - } - init() { - return __async(this, null, function* () { - try { - this.gitManager = new SimpleGit(this); - const result = yield this.gitManager.checkRequirements(); - switch (result) { - case "missing-git": - this.displayError("Cannot run git command"); - break; - case "missing-repo": - new import_obsidian14.Notice("Can't find a valid git repository. Please create one via the given command."); - break; - case "valid": - this.gitReady = true; - this.setState(PluginState.idle); - if (this.settings.autoPullOnBoot) { - this.promiseQueue.addTask(() => this.pullChangesFromRemote()); - } - const lastAutos = yield this.loadLastAuto(); - if (this.settings.autoSaveInterval > 0) { - const now2 = new Date(); - const diff = this.settings.autoSaveInterval - Math.round((now2.getTime() - lastAutos.backup.getTime()) / 1e3 / 60); - this.startAutoBackup(diff <= 0 ? 0 : diff); - } - if (this.settings.autoPullInterval > 0) { - const now2 = new Date(); - const diff = this.settings.autoPullInterval - Math.round((now2.getTime() - lastAutos.pull.getTime()) / 1e3 / 60); - this.startAutoPull(diff <= 0 ? 0 : diff); - } - break; - default: - console.log("Something weird happened. The 'checkRequirements' result is " + result); - } - } catch (error) { - this.displayError(error); - console.error(error); - } - }); - } - createNewRepo() { - return __async(this, null, function* () { - yield this.gitManager.init(); - new import_obsidian14.Notice("Initialized new repo"); - }); - } - cloneNewRepo() { - return __async(this, null, function* () { - const modal = new GeneralModal(this.app, [], "Enter remote URL"); - const url = yield modal.open(); - if (url) { - let dir = yield new GeneralModal(this.app, [], "Enter directory for clone. It needs to be empty or not existent.").open(); - if (dir) { - dir = path2.normalize(dir); - new import_obsidian14.Notice(`Cloning new repo into "${dir}"`); - yield this.gitManager.clone(url, dir); - new import_obsidian14.Notice("Cloned new repo"); - } - } - }); - } - isAllInitialized() { - return __async(this, null, function* () { - if (!this.gitReady) { - yield this.init(); - } - return this.gitReady; - }); - } - pullChangesFromRemote() { - return __async(this, null, function* () { - if (!(yield this.isAllInitialized())) - return; - const filesUpdated = yield this.pull(); - if (!filesUpdated) { - this.displayMessage("Everything is up-to-date"); - } - if (this.gitManager instanceof SimpleGit) { - const status = yield this.gitManager.status(); - if (status.conflicted.length > 0) { - this.displayError(`You have ${status.conflicted.length} conflict ${status.conflicted.length > 1 ? "files" : "file"}`); - } - } - dispatchEvent(new CustomEvent("git-source-control-refresh")); - this.lastUpdate = Date.now(); - this.setState(PluginState.idle); - }); - } - createBackup(fromAutoBackup, requestCustomMessage = false) { - return __async(this, null, function* () { - if (!(yield this.isAllInitialized())) - return; - if (!fromAutoBackup) { - const file = this.app.vault.getAbstractFileByPath(this.conflictOutputFile); - yield this.app.vault.delete(file); - } - if (this.gitManager instanceof SimpleGit) { - const status = yield this.gitManager.status(); - if (fromAutoBackup && status.conflicted.length > 0) { - this.setState(PluginState.idle); - this.displayError(`Did not commit, because you have ${status.conflicted.length} conflict ${status.conflicted.length > 1 ? "files" : "file"}. Please resolve them and commit per command.`); - this.handleConflict(status.conflicted); - return; - } - } - if (!(yield this.commit(fromAutoBackup, requestCustomMessage))) - return; - if (!this.settings.disablePush) { - if (yield this.gitManager.canPush()) { - if (this.settings.pullBeforePush) { - yield this.pull(); - } - if (!(yield this.push())) - return; - } else { - this.displayMessage("No changes to push"); - } - } - this.setState(PluginState.idle); - }); - } - commit(fromAutoBackup, requestCustomMessage = false) { - return __async(this, null, function* () { - if (!(yield this.isAllInitialized())) - return false; - const changedFiles = (yield this.gitManager.status()).changed; - if (changedFiles.length !== 0) { - let commitMessage = fromAutoBackup ? this.settings.autoCommitMessage : this.settings.commitMessage; - if (fromAutoBackup && this.settings.customMessageOnAutoBackup || requestCustomMessage) { - if (!this.settings.disablePopups && fromAutoBackup) { - new import_obsidian14.Notice("Auto backup: Please enter a custom commit message. Leave empty to abort"); - } - const tempMessage = yield new CustomMessageModal(this, true).open(); - if (tempMessage != void 0 && tempMessage != "" && tempMessage != "...") { - commitMessage = tempMessage; - } else { - this.setState(PluginState.idle); - return false; - } - } - const committedFiles = yield this.gitManager.commitAll(commitMessage); - this.displayMessage(`Committed ${committedFiles} ${committedFiles > 1 ? "files" : "file"}`); - } else { - this.displayMessage("No changes to commit"); - } - dispatchEvent(new CustomEvent("git-source-control-refresh")); - this.setState(PluginState.idle); - return true; - }); - } - push() { - return __async(this, null, function* () { - if (!(yield this.isAllInitialized())) - return false; - if (!this.remotesAreSet()) { - return false; - } - let status; - if (this.gitManager instanceof SimpleGit && (status = yield this.gitManager.status()).conflicted.length > 0) { - this.displayError(`Cannot push. You have ${status.conflicted.length} conflict ${status.conflicted.length > 1 ? "files" : "file"}`); - this.handleConflict(status.conflicted); - return false; - } else { - const pushedFiles = yield this.gitManager.push(); - this.lastUpdate = Date.now(); - this.displayMessage(`Pushed ${pushedFiles} ${pushedFiles > 1 ? "files" : "file"} to remote`); - this.setState(PluginState.idle); - return true; - } - }); - } - pull() { - return __async(this, null, function* () { - const pulledFilesLength = yield this.gitManager.pull(); - if (pulledFilesLength > 0) { - this.displayMessage(`Pulled ${pulledFilesLength} ${pulledFilesLength > 1 ? "files" : "file"} from remote`); - } - return pulledFilesLength != 0; - }); - } - remotesAreSet() { - return __async(this, null, function* () { - if (!(yield this.gitManager.branchInfo()).tracking) { - new import_obsidian14.Notice("No upstream branch is set. Please select one."); - const remoteBranch = yield this.selectRemoteBranch(); - if (remoteBranch == void 0) { - this.displayError("Did not push. No upstream-branch is set!", 1e4); - this.setState(PluginState.idle); - return false; - } else { - yield this.gitManager.updateUpstreamBranch(remoteBranch); - return true; - } - } - return true; - }); - } - startAutoBackup(minutes) { - const time = (minutes != null ? minutes : this.settings.autoSaveInterval) * 6e4; - if (this.settings.autoBackupAfterFileChange) { - if (minutes === 0) { - this.doAutoBackup(); - } else { - this.onFileModifyEventRef = this.app.vault.on("modify", () => this.autoBackupDebouncer()); - this.autoBackupDebouncer = (0, import_obsidian14.debounce)(() => this.doAutoBackup(), time, true); - } - } else { - this.timeoutIDBackup = window.setTimeout(() => this.doAutoBackup(), time); - } - } - doAutoBackup() { - this.promiseQueue.addTask(() => this.createBackup(true)); - this.saveLastAuto(new Date(), "backup"); - this.saveSettings(); - this.startAutoBackup(); - } - startAutoPull(minutes) { - this.timeoutIDPull = window.setTimeout(() => { - this.promiseQueue.addTask(() => this.pullChangesFromRemote()); - this.saveLastAuto(new Date(), "pull"); - this.saveSettings(); - this.startAutoPull(); - }, (minutes != null ? minutes : this.settings.autoPullInterval) * 6e4); - } - clearAutoBackup() { - var _a; - let wasActive = false; - if (this.timeoutIDBackup) { - window.clearTimeout(this.timeoutIDBackup); - this.timeoutIDBackup = void 0; - wasActive = true; - } - if (this.onFileModifyEventRef) { - (_a = this.autoBackupDebouncer) == null ? void 0 : _a.cancel(); - this.app.vault.offref(this.onFileModifyEventRef); - this.onFileModifyEventRef = void 0; - wasActive = true; - } - return wasActive; - } - clearAutoPull() { - if (this.timeoutIDPull) { - window.clearTimeout(this.timeoutIDPull); - this.timeoutIDPull = void 0; - return true; - } - return false; - } - handleConflict(conflicted) { - return __async(this, null, function* () { - this.setState(PluginState.conflicted); - const lines = [ - "# Conflict files", - "Please resolve them and commit per command (This file will be deleted before the commit).", - ...conflicted.map((e) => { - const file = this.app.vault.getAbstractFileByPath(e); - if (file instanceof import_obsidian14.TFile) { - const link = this.app.metadataCache.fileToLinktext(file, "/"); - return `- [[${link}]]`; - } else { - return `- Not a file: ${e}`; - } - }) - ]; - this.writeAndOpenFile(lines.join("\n")); - }); - } - editRemotes() { - return __async(this, null, function* () { - if (!(yield this.isAllInitialized())) - return; - const remotes = yield this.gitManager.getRemotes(); - const nameModal = new GeneralModal(this.app, remotes, "Select or create a new remote by typing its name and selecting it"); - const remoteName = yield nameModal.open(); - if (remoteName) { - const urlModal = new GeneralModal(this.app, [], "Enter the remote URL"); - const remoteURL = yield urlModal.open(); - yield this.gitManager.setRemote(remoteName, remoteURL); - return remoteName; - } - }); - } - selectRemoteBranch() { - return __async(this, null, function* () { - let remotes = yield this.gitManager.getRemotes(); - let selectedRemote; - if (remotes.length === 0) { - selectedRemote = yield this.editRemotes(); - if (selectedRemote == void 0) { - remotes = yield this.gitManager.getRemotes(); - } - } - const nameModal = new GeneralModal(this.app, remotes, "Select or create a new remote by typing its name and selecting it"); - const remoteName = selectedRemote != null ? selectedRemote : yield nameModal.open(); - if (remoteName) { - this.displayMessage("Fetching remote branches"); - yield this.gitManager.fetch(remoteName); - const branches = yield this.gitManager.getRemoteBranches(remoteName); - const branchModal = new GeneralModal(this.app, branches, "Select or create a new remote branch by typing its name and selecting it"); - return yield branchModal.open(); - } - }); - } - removeRemote() { - return __async(this, null, function* () { - if (!(yield this.isAllInitialized())) - return; - const remotes = yield this.gitManager.getRemotes(); - const nameModal = new GeneralModal(this.app, remotes, "Select a remote"); - const remoteName = yield nameModal.open(); - if (remoteName) { - this.gitManager.removeRemote(remoteName); - } - }); - } - writeAndOpenFile(text2) { - return __async(this, null, function* () { - yield this.app.vault.adapter.write(this.conflictOutputFile, text2); - let fileIsAlreadyOpened = false; - this.app.workspace.iterateAllLeaves((leaf) => { - if (leaf.getDisplayText() != "" && this.conflictOutputFile.startsWith(leaf.getDisplayText())) { - fileIsAlreadyOpened = true; - } - }); - if (!fileIsAlreadyOpened) { - this.app.workspace.openLinkText(this.conflictOutputFile, "/", true); - } - }); - } - displayMessage(message, timeout = 4 * 1e3) { - var _a; - (_a = this.statusBar) == null ? void 0 : _a.displayMessage(message.toLowerCase(), timeout); - if (!this.settings.disablePopups) { - new import_obsidian14.Notice(message, 5 * 1e3); - } - console.log(`git obsidian message: ${message}`); - } - displayError(message, timeout = 0) { - var _a; - message = message.toString(); - new import_obsidian14.Notice(message, 15 * 1e3); - console.log(`git obsidian error: ${message}`); - (_a = this.statusBar) == null ? void 0 : _a.displayMessage(message.toLowerCase(), timeout); - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = {}); -/*! - Copyright (c) 2016 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ diff --git a/.obsidian/plugins/obsidian-git/manifest.json b/.obsidian/plugins/obsidian-git/manifest.json deleted file mode 100644 index 1d0a3b1..0000000 --- a/.obsidian/plugins/obsidian-git/manifest.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "obsidian-git", - "name": "Obsidian Git", - "description": "Backup your vault with git.", - "isDesktopOnly": true, - "js": "main.js", - "version": "1.22.0" -} diff --git a/.obsidian/plugins/obsidian-git/styles.css b/.obsidian/plugins/obsidian-git/styles.css deleted file mode 100644 index 3455a4d..0000000 --- a/.obsidian/plugins/obsidian-git/styles.css +++ /dev/null @@ -1,384 +0,0 @@ -@keyframes loading { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(360deg); - } -} - -.loading > svg { - animation: 2s linear infinite loading; - transform-origin: 50% 50%; - display: inline-block; -} -.obsidian-git-center { - margin: auto; - width: 50%; -} -.tooltip.mod-left { - overflow-wrap: break-word; -} -.tooltip.mod-right { - overflow-wrap: break-word; -} -.obsidian-git-shortcuts { - margin: 10px; -} - -.diff-err { - height: 100%; - display: flex; - justify-content: center; - flex-direction: column; - align-items: center; -} - -.diff-err-sign { - font-size: 2em; -} - -.d2h-d-none { - display: none; -} -.d2h-wrapper { - text-align: left; -} -.d2h-file-header { - background-color: var(--background-primary); - border-bottom: 1px solid var(--interactive-accent); - font-family: var(--font-monospace); - height: 35px; - padding: 5px 10px; -} -.d2h-file-header, -.d2h-file-stats { - display: -webkit-box; - display: -ms-flexbox; - display: flex; -} -.d2h-file-stats { - font-size: 14px; - margin-left: auto; -} -.d2h-lines-added { - border: 1px solid #b4e2b4; - border-radius: 5px 0 0 5px; - color: #399839; - padding: 2px; - text-align: right; - vertical-align: middle; -} -.d2h-lines-deleted { - border: 1px solid #e9aeae; - border-radius: 0 5px 5px 0; - color: #c33; - margin-left: 1px; - padding: 2px; - text-align: left; - vertical-align: middle; -} -.d2h-file-name-wrapper { - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - font-size: 15px; - width: 100%; -} -.d2h-file-name { - overflow-x: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} -.d2h-file-wrapper { - border: 1px solid var(--background-modifier-border); - border-radius: 3px; - margin-bottom: 1em; -} -.d2h-file-collapse { - -webkit-box-pack: end; - -ms-flex-pack: end; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - border: 1px solid var(--background-modifier-border); - border-radius: 3px; - cursor: pointer; - display: none; - font-size: 12px; - justify-content: flex-end; - padding: 4px 8px; -} -.d2h-file-collapse.d2h-selected { - background-color: #c8e1ff; -} -.d2h-file-collapse-input { - margin: 0 4px 0 0; -} -.d2h-diff-table { - border-collapse: collapse; - font-family: Menlo, Consolas, monospace; - font-size: 13px; - width: 100%; -} -.d2h-files-diff { - width: 100%; -} -.d2h-file-diff { - overflow-y: hidden; -} -.d2h-file-side-diff { - display: inline-block; - margin-bottom: -8px; - margin-right: -4px; - overflow-x: scroll; - overflow-y: hidden; - width: 50%; -} -.d2h-code-line { - padding: 0 8em; -} -.d2h-code-line, -.d2h-code-side-line { - display: inline-block; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - white-space: nowrap; - width: 100%; -} -.d2h-code-side-line { - padding: 0 4.5em; -} -.d2h-code-line-ctn { - word-wrap: normal; - background: none; - display: inline-block; - padding: 0; - -webkit-user-select: text; - -moz-user-select: text; - -ms-user-select: text; - user-select: text; - vertical-align: middle; - white-space: pre; - width: 100%; -} -.theme-light .d2h-code-line del, -.theme-light .d2h-code-side-line del { - background-color: #ffb6ba; -} -.theme-dark .d2h-code-line del, -.theme-dark .d2h-code-side-line del { - background-color: #8d232881; -} -.d2h-code-line del, -.d2h-code-line ins, -.d2h-code-side-line del, -.d2h-code-side-line ins { - border-radius: 0.2em; - display: inline-block; - margin-top: -1px; - text-decoration: none; - vertical-align: middle; -} -.theme-light .d2h-code-line ins, -.theme-light .d2h-code-side-line ins { - background-color: #97f295; - text-align: left; -} -.theme-dark .d2h-code-line ins, -.theme-dark .d2h-code-side-line ins { - background-color: #1d921996; - text-align: left; -} -.d2h-code-line-prefix { - word-wrap: normal; - background: none; - display: inline; - padding: 0; - white-space: pre; -} -.line-num1 { - float: left; -} -.line-num1, -.line-num2 { - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - padding: 0 0.5em; - text-overflow: ellipsis; - width: 3.5em; -} -.line-num2 { - float: right; -} -.d2h-code-linenumber { - background-color: var(--background-primary); - border: solid var(--background-modifier-border); - border-width: 0 1px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: var(--text-muted); - cursor: pointer; - display: inline-block; - position: absolute; - text-align: right; - width: 7.5em; -} -.d2h-code-linenumber:after { - content: "\200b"; -} -.d2h-code-side-linenumber { - background-color: var(--background-primary); - border: solid var(--background-modifier-border); - border-width: 0 1px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: var(--text-muted); - cursor: pointer; - display: inline-block; - overflow: hidden; - padding: 0 0.5em; - position: absolute; - text-align: right; - text-overflow: ellipsis; - width: 4em; -} -.d2h-code-side-linenumber:after { - content: "\200b"; -} -.d2h-code-side-emptyplaceholder, -.d2h-emptyplaceholder { - background-color: var(--background-primary); - border-color: var(--background-modifier-border); -} -.d2h-code-line-prefix, -.d2h-code-linenumber, -.d2h-code-side-linenumber, -.d2h-emptyplaceholder { - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.d2h-code-linenumber, -.d2h-code-side-linenumber { - direction: rtl; -} -.theme-light .d2h-del { - background-color: #fee8e9; - border-color: #e9aeae; -} -.theme-light .d2h-ins { - background-color: #dfd; - border-color: #b4e2b4; -} -.theme-dark .d2h-del { - background-color: #521b1d83; - border-color: #691d1d73; -} -.theme-dark .d2h-ins { - background-color: rgba(30, 71, 30, 0.5); - border-color: #13501381; -} -.d2h-info { - background-color: var(--background-primary); - border-color: var(--background-modifier-border); - color: var(--text-normal); -} -.theme-light .d2h-file-diff .d2h-del.d2h-change { - background-color: #fdf2d0; -} -.theme-dark .d2h-file-diff .d2h-del.d2h-change { - background-color: #55492480; -} -.theme-light .d2h-file-diff .d2h-ins.d2h-change { - background-color: #ded; -} -.theme-dark .d2h-file-diff .d2h-ins.d2h-change { - background-color: rgba(37, 78, 37, 0.418); -} -.d2h-file-list-wrapper { - margin-bottom: 10px; -} -.d2h-file-list-wrapper a { - color: #3572b0; - text-decoration: none; -} -.d2h-file-list-wrapper a:visited { - color: #3572b0; -} -.d2h-file-list-header { - text-align: left; -} -.d2h-file-list-title { - font-weight: 700; -} -.d2h-file-list-line { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - text-align: left; -} -.d2h-file-list { - display: block; - list-style: none; - margin: 0; - padding: 0; -} -.d2h-file-list > li { - border-bottom: 1px solid var(--background-modifier-border); - margin: 0; - padding: 5px 10px; -} -.d2h-file-list > li:last-child { - border-bottom: none; -} -.d2h-file-switch { - cursor: pointer; - display: none; - font-size: 10px; -} -.d2h-icon { - fill: currentColor; - margin-right: 10px; - vertical-align: middle; -} -.d2h-deleted { - color: #c33; -} -.d2h-added { - color: #399839; -} -.d2h-changed { - color: #d0b44c; -} -.d2h-moved { - color: #3572b0; -} -.d2h-tag { - background-color: var(--background-primary); - display: -webkit-box; - display: -ms-flexbox; - display: flex; - font-size: 10px; - margin-left: 5px; - padding: 0 2px; -} -.d2h-deleted-tag { - border: 2px solid #c33; -} -.d2h-added-tag { - border: 1px solid #399839; -} -.d2h-changed-tag { - border: 1px solid #d0b44c; -} -.d2h-moved-tag { - border: 1px solid #3572b0; -} diff --git a/.obsidian/workspace b/.obsidian/workspace index e7e2b55..f8616a2 100644 --- a/.obsidian/workspace +++ b/.obsidian/workspace @@ -9,7 +9,7 @@ "state": { "type": "markdown", "state": { - "file": "随时随地/简单的 React 思考 - Context.md", + "file": "随时随地/React Hooks 的碎片记录.md", "mode": "source", "source": false } @@ -69,7 +69,7 @@ "state": { "type": "backlink", "state": { - "file": "随时随地/简单的 React 思考 - Context.md", + "file": "随时随地/React Hooks 的碎片记录.md", "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical", @@ -89,15 +89,15 @@ }, "active": "1508f46ea2481b37", "lastOpenFiles": [ - "随时随地/简单的 React 思考 - Context.md", - "随时随地/简单的 React 思考 - useCallback.md", - "随时随地/简单的 React 思考 - useMemo.md", + "随时随地/React Hooks 的碎片记录.md", "随时随地/奇怪的疑惑.md", "随时随地/简单的 React 思考 - useReducer.md", - "随时随地/简单的 React 思考 - Fiber 创建.md", - "随时随地/React Hooks 的碎片记录.md", + "随时随地/简单的 React 思考 - useMemo.md", "随时随地/useEffect 和 Debounce.md", - "随时随地/简单的 React 思考 - 状态管理工具.md", - "1648111615(1) 5.png.md" + "1648111615(1) 5.png.md", + "1648111615(1).png", + "1648111615(1) 5.png", + "随时随地/简单的 React 思考 - Hook.md", + "随时随地/简单的 React 思考 - Fiber 创建.md" ] } \ No newline at end of file