diff --git a/.obsidian/plugins/obsidian-git/main.js b/.obsidian/plugins/obsidian-git/main.js index 0815026..cd3a7f6 100644 --- a/.obsidian/plugins/obsidian-git/main.js +++ b/.obsidian/plugins/obsidian-git/main.js @@ -678,7 +678,7 @@ var require_buffer = __commonJS({ return slowToString.apply(this, arguments); }; Buffer2.prototype.toLocaleString = Buffer2.prototype.toString; - Buffer2.prototype.equals = function equals2(b) { + Buffer2.prototype.equals = function equals3(b) { if (!Buffer2.isBuffer(b)) throw new TypeError("Argument must be a Buffer"); if (this === b) @@ -1939,9 +1939,9 @@ var init_polyfill_buffer = __esm({ } }); -// node_modules/.pnpm/async-lock@1.4.0/node_modules/async-lock/lib/index.js +// node_modules/.pnpm/async-lock@1.4.1/node_modules/async-lock/lib/index.js var require_lib = __commonJS({ - "node_modules/.pnpm/async-lock@1.4.0/node_modules/async-lock/lib/index.js"(exports2, module2) { + "node_modules/.pnpm/async-lock@1.4.1/node_modules/async-lock/lib/index.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var AsyncLock2 = function(opts) { @@ -2078,12 +2078,13 @@ var require_lib = __commonJS({ if (self2.domainReentrant && !!process.domain) { exec = process.domain.bind(exec); } + var maxPending = opts.maxPending || self2.maxPending; if (!self2.queues[key2]) { self2.queues[key2] = []; exec(true); } else if (self2.domainReentrant && !!process.domain && process.domain === self2.domains[key2]) { exec(false); - } else if (self2.queues[key2].length >= self2.maxPending) { + } else if (self2.queues[key2].length >= maxPending) { done(false, new Error("Too many pending tasks in queue " + key2)); } else { var taskFn = function() { @@ -2164,9 +2165,9 @@ var require_lib = __commonJS({ } }); -// node_modules/.pnpm/async-lock@1.4.0/node_modules/async-lock/index.js +// node_modules/.pnpm/async-lock@1.4.1/node_modules/async-lock/index.js var require_async_lock = __commonJS({ - "node_modules/.pnpm/async-lock@1.4.0/node_modules/async-lock/index.js"(exports2, module2) { + "node_modules/.pnpm/async-lock@1.4.1/node_modules/async-lock/index.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); module2.exports = require_lib(); @@ -6800,9 +6801,9 @@ var require_pify = __commonJS({ } }); -// node_modules/.pnpm/ignore@5.2.4/node_modules/ignore/index.js +// node_modules/.pnpm/ignore@5.3.1/node_modules/ignore/index.js var require_ignore = __commonJS({ - "node_modules/.pnpm/ignore@5.2.4/node_modules/ignore/index.js"(exports2, module2) { + "node_modules/.pnpm/ignore@5.3.1/node_modules/ignore/index.js"(exports2, module2) { init_polyfill_buffer(); function makeArray(subject) { return Array.isArray(subject) ? subject : [subject]; @@ -6834,6 +6835,13 @@ var require_ignore = __commonJS({ return slashes.slice(0, length - length % 2); }; var REPLACERS = [ + [ + // remove BOM + // TODO: + // Other similar zero-width characters? + /^\uFEFF/, + () => EMPTY + ], // > Trailing spaces are ignored unless they are quoted with backslash ("\") [ // (a\ ) -> (a ) @@ -7344,14 +7352,14 @@ var require_diff3 = __commonJS({ init_polyfill_buffer(); var onp = require_onp(); function longestCommonSubsequence(file1, file2) { - var diff2 = new onp(file1, file2); - diff2.compose(); - var ses = diff2.getses(); + var diff3 = new onp(file1, file2); + diff3.compose(); + var ses = diff3.getses(); var root2; var prev; var file1RevIdx = file1.length - 1, file2RevIdx = file2.length - 1; for (var i = ses.length - 1; i >= 0; --i) { - if (ses[i].t === diff2.SES_COMMON) { + if (ses[i].t === diff3.SES_COMMON) { if (prev) { prev.chain = { file1index: file1RevIdx, @@ -7369,9 +7377,9 @@ var require_diff3 = __commonJS({ } file1RevIdx--; file2RevIdx--; - } else if (ses[i].t === diff2.SES_DELETE) { + } else if (ses[i].t === diff3.SES_DELETE) { file1RevIdx--; - } else if (ses[i].t === diff2.SES_ADD) { + } else if (ses[i].t === diff3.SES_ADD) { file2RevIdx--; } } @@ -7834,7 +7842,7 @@ var require_browser = __commonJS({ exports2.load = load; exports2.useColors = useColors; exports2.storage = localstorage(); - exports2.destroy = (() => { + exports2.destroy = /* @__PURE__ */ (() => { let warned = false; return () => { if (!warned) { @@ -8845,6 +8853,69 @@ var require_object_keys = __commonJS({ } }); +// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js +var require_es_errors = __commonJS({ + "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js"(exports2, module2) { + "use strict"; + init_polyfill_buffer(); + module2.exports = Error; + } +}); + +// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js +var require_eval = __commonJS({ + "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js"(exports2, module2) { + "use strict"; + init_polyfill_buffer(); + module2.exports = EvalError; + } +}); + +// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js +var require_range = __commonJS({ + "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js"(exports2, module2) { + "use strict"; + init_polyfill_buffer(); + module2.exports = RangeError; + } +}); + +// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js +var require_ref = __commonJS({ + "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js"(exports2, module2) { + "use strict"; + init_polyfill_buffer(); + module2.exports = ReferenceError; + } +}); + +// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js +var require_syntax = __commonJS({ + "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js"(exports2, module2) { + "use strict"; + init_polyfill_buffer(); + module2.exports = SyntaxError; + } +}); + +// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js +var require_type = __commonJS({ + "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js"(exports2, module2) { + "use strict"; + init_polyfill_buffer(); + module2.exports = TypeError; + } +}); + +// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js +var require_uri = __commonJS({ + "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js"(exports2, module2) { + "use strict"; + init_polyfill_buffer(); + module2.exports = URIError; + } +}); + // node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.js var require_shams = __commonJS({ "node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.js"(exports2, module2) { @@ -8938,45 +9009,71 @@ var require_has_proto = __commonJS({ } }); -// node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/implementation.js +// node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js var require_implementation2 = __commonJS({ - "node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/implementation.js"(exports2, module2) { + "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; - var slice = Array.prototype.slice; var toStr = Object.prototype.toString; + var max = Math.max; var funcType = "[object Function]"; + var concatty = function concatty2(a, b) { + var arr = []; + for (var i = 0; i < a.length; i += 1) { + arr[i] = a[i]; + } + for (var j = 0; j < b.length; j += 1) { + arr[j + a.length] = b[j]; + } + return arr; + }; + var slicy = function slicy2(arrLike, offset) { + var arr = []; + for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { + arr[j] = arrLike[i]; + } + return arr; + }; + var joiny = function(arr, joiner) { + var str = ""; + for (var i = 0; i < arr.length; i += 1) { + str += arr[i]; + if (i + 1 < arr.length) { + str += joiner; + } + } + return str; + }; module2.exports = function bind(that) { var target = this; - if (typeof target !== "function" || toStr.call(target) !== funcType) { + if (typeof target !== "function" || toStr.apply(target) !== funcType) { throw new TypeError(ERROR_MESSAGE + target); } - var args = slice.call(arguments, 1); + var args = slicy(arguments, 1); var bound; var binder = function() { if (this instanceof bound) { var result = target.apply( this, - args.concat(slice.call(arguments)) + concatty(args, arguments) ); if (Object(result) === result) { return result; } return this; - } else { - return target.apply( - that, - args.concat(slice.call(arguments)) - ); } + return target.apply( + that, + concatty(args, arguments) + ); }; - var boundLength = Math.max(0, target.length - args.length); + var boundLength = max(0, target.length - args.length); var boundArgs = []; for (var i = 0; i < boundLength; i++) { - boundArgs.push("$" + i); + boundArgs[i] = "$" + i; } - bound = Function("binder", "return function (" + boundArgs.join(",") + "){ return binder.apply(this,arguments); }")(binder); + bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder); if (target.prototype) { var Empty = function Empty2() { }; @@ -8989,9 +9086,9 @@ var require_implementation2 = __commonJS({ } }); -// node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/index.js +// node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js var require_function_bind = __commonJS({ - "node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/index.js"(exports2, module2) { + "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var implementation = require_implementation2(); @@ -8999,25 +9096,32 @@ var require_function_bind = __commonJS({ } }); -// node_modules/.pnpm/has@1.0.3/node_modules/has/src/index.js -var require_src2 = __commonJS({ - "node_modules/.pnpm/has@1.0.3/node_modules/has/src/index.js"(exports2, module2) { +// node_modules/.pnpm/hasown@2.0.1/node_modules/hasown/index.js +var require_hasown = __commonJS({ + "node_modules/.pnpm/hasown@2.0.1/node_modules/hasown/index.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); + var call = Function.prototype.call; + var $hasOwn = Object.prototype.hasOwnProperty; var bind = require_function_bind(); - module2.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); + module2.exports = bind.call(call, $hasOwn); } }); -// node_modules/.pnpm/get-intrinsic@1.2.1/node_modules/get-intrinsic/index.js +// node_modules/.pnpm/get-intrinsic@1.2.4/node_modules/get-intrinsic/index.js var require_get_intrinsic = __commonJS({ - "node_modules/.pnpm/get-intrinsic@1.2.1/node_modules/get-intrinsic/index.js"(exports2, module2) { + "node_modules/.pnpm/get-intrinsic@1.2.4/node_modules/get-intrinsic/index.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var undefined2; - var $SyntaxError = SyntaxError; + var $Error = require_es_errors(); + var $EvalError = require_eval(); + var $RangeError = require_range(); + var $ReferenceError = require_ref(); + var $SyntaxError = require_syntax(); + var $TypeError = require_type(); + var $URIError = require_uri(); var $Function = Function; - var $TypeError = TypeError; var getEvalledConstructor = function(expressionSyntax) { try { return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")(); @@ -9055,6 +9159,7 @@ var require_get_intrinsic = __commonJS({ var needsEval = {}; var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined2 : getProto(Uint8Array); var INTRINSICS = { + __proto__: null, "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError, "%Array%": Array, "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer, @@ -9075,10 +9180,10 @@ var require_get_intrinsic = __commonJS({ "%decodeURIComponent%": decodeURIComponent, "%encodeURI%": encodeURI, "%encodeURIComponent%": encodeURIComponent, - "%Error%": Error, + "%Error%": $Error, "%eval%": eval, // eslint-disable-line no-eval - "%EvalError%": EvalError, + "%EvalError%": $EvalError, "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array, "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array, "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry, @@ -9100,8 +9205,8 @@ var require_get_intrinsic = __commonJS({ "%parseInt%": parseInt, "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise, "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy, - "%RangeError%": RangeError, - "%ReferenceError%": ReferenceError, + "%RangeError%": $RangeError, + "%ReferenceError%": $ReferenceError, "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect, "%RegExp%": RegExp, "%Set%": typeof Set === "undefined" ? undefined2 : Set, @@ -9118,7 +9223,7 @@ var require_get_intrinsic = __commonJS({ "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray, "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array, "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array, - "%URIError%": URIError, + "%URIError%": $URIError, "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap, "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef, "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet @@ -9155,6 +9260,7 @@ var require_get_intrinsic = __commonJS({ return value; }; var LEGACY_ALIASES = { + __proto__: null, "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], "%ArrayPrototype%": ["Array", "prototype"], "%ArrayProto_entries%": ["Array", "prototype", "entries"], @@ -9208,7 +9314,7 @@ var require_get_intrinsic = __commonJS({ "%WeakSetPrototype%": ["WeakSet", "prototype"] }; var bind = require_function_bind(); - var hasOwn = require_src2(); + var hasOwn = require_hasown(); var $concat = bind.call(Function.call, Array.prototype.concat); var $spliceApply = bind.call(Function.apply, Array.prototype.splice); var $replace = bind.call(Function.call, String.prototype.replace); @@ -9317,9 +9423,9 @@ var require_get_intrinsic = __commonJS({ } }); -// node_modules/.pnpm/has-property-descriptors@1.0.0/node_modules/has-property-descriptors/index.js +// node_modules/.pnpm/has-property-descriptors@1.0.1/node_modules/has-property-descriptors/index.js var require_has_property_descriptors = __commonJS({ - "node_modules/.pnpm/has-property-descriptors@1.0.0/node_modules/has-property-descriptors/index.js"(exports2, module2) { + "node_modules/.pnpm/has-property-descriptors@1.0.1/node_modules/has-property-descriptors/index.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var GetIntrinsic = require_get_intrinsic(); @@ -9349,21 +9455,96 @@ var require_has_property_descriptors = __commonJS({ } }); -// node_modules/.pnpm/define-properties@1.2.0/node_modules/define-properties/index.js +// node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.js +var require_gopd = __commonJS({ + "node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.js"(exports2, module2) { + "use strict"; + init_polyfill_buffer(); + var GetIntrinsic = require_get_intrinsic(); + var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true); + if ($gOPD) { + try { + $gOPD([], "length"); + } catch (e) { + $gOPD = null; + } + } + module2.exports = $gOPD; + } +}); + +// node_modules/.pnpm/define-data-property@1.1.2/node_modules/define-data-property/index.js +var require_define_data_property = __commonJS({ + "node_modules/.pnpm/define-data-property@1.1.2/node_modules/define-data-property/index.js"(exports2, module2) { + "use strict"; + init_polyfill_buffer(); + var hasPropertyDescriptors = require_has_property_descriptors()(); + var GetIntrinsic = require_get_intrinsic(); + var $defineProperty = hasPropertyDescriptors && GetIntrinsic("%Object.defineProperty%", true); + if ($defineProperty) { + try { + $defineProperty({}, "a", { value: 1 }); + } catch (e) { + $defineProperty = false; + } + } + var $SyntaxError = require_syntax(); + var $TypeError = require_type(); + var gopd = require_gopd(); + module2.exports = function defineDataProperty(obj, property, value) { + if (!obj || typeof obj !== "object" && typeof obj !== "function") { + throw new $TypeError("`obj` must be an object or a function`"); + } + if (typeof property !== "string" && typeof property !== "symbol") { + throw new $TypeError("`property` must be a string or a symbol`"); + } + if (arguments.length > 3 && typeof arguments[3] !== "boolean" && arguments[3] !== null) { + throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null"); + } + if (arguments.length > 4 && typeof arguments[4] !== "boolean" && arguments[4] !== null) { + throw new $TypeError("`nonWritable`, if provided, must be a boolean or null"); + } + if (arguments.length > 5 && typeof arguments[5] !== "boolean" && arguments[5] !== null) { + throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null"); + } + if (arguments.length > 6 && typeof arguments[6] !== "boolean") { + throw new $TypeError("`loose`, if provided, must be a boolean"); + } + var nonEnumerable = arguments.length > 3 ? arguments[3] : null; + var nonWritable = arguments.length > 4 ? arguments[4] : null; + var nonConfigurable = arguments.length > 5 ? arguments[5] : null; + var loose = arguments.length > 6 ? arguments[6] : false; + var desc = !!gopd && gopd(obj, property); + if ($defineProperty) { + $defineProperty(obj, property, { + configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, + enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, + value, + writable: nonWritable === null && desc ? desc.writable : !nonWritable + }); + } else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) { + obj[property] = value; + } else { + throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable."); + } + }; + } +}); + +// node_modules/.pnpm/define-properties@1.2.1/node_modules/define-properties/index.js var require_define_properties = __commonJS({ - "node_modules/.pnpm/define-properties@1.2.0/node_modules/define-properties/index.js"(exports2, module2) { + "node_modules/.pnpm/define-properties@1.2.1/node_modules/define-properties/index.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var keys = require_object_keys(); var hasSymbols = typeof Symbol === "function" && typeof Symbol("foo") === "symbol"; var toStr = Object.prototype.toString; var concat = Array.prototype.concat; - var origDefineProperty = Object.defineProperty; + var defineDataProperty = require_define_data_property(); var isFunction2 = function(fn) { return typeof fn === "function" && toStr.call(fn) === "[object Function]"; }; - var hasPropertyDescriptors = require_has_property_descriptors()(); - var supportsDescriptors = origDefineProperty && hasPropertyDescriptors; + var supportsDescriptors = require_has_property_descriptors()(); var defineProperty = function(object, name, value, predicate) { if (name in object) { if (predicate === true) { @@ -9375,14 +9556,9 @@ var require_define_properties = __commonJS({ } } if (supportsDescriptors) { - origDefineProperty(object, name, { - configurable: true, - enumerable: false, - value, - writable: true - }); + defineDataProperty(object, name, value, true); } else { - object[name] = value; + defineDataProperty(object, name, value); } }; var defineProperties = function(object, map) { @@ -9400,17 +9576,72 @@ var require_define_properties = __commonJS({ } }); -// node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/index.js +// node_modules/.pnpm/set-function-length@1.2.1/node_modules/set-function-length/index.js +var require_set_function_length = __commonJS({ + "node_modules/.pnpm/set-function-length@1.2.1/node_modules/set-function-length/index.js"(exports2, module2) { + "use strict"; + init_polyfill_buffer(); + var GetIntrinsic = require_get_intrinsic(); + var define2 = require_define_data_property(); + var hasDescriptors = require_has_property_descriptors()(); + var gOPD = require_gopd(); + var $TypeError = require_type(); + var $floor = GetIntrinsic("%Math.floor%"); + module2.exports = function setFunctionLength(fn, length) { + if (typeof fn !== "function") { + throw new $TypeError("`fn` is not a function"); + } + if (typeof length !== "number" || length < 0 || length > 4294967295 || $floor(length) !== length) { + throw new $TypeError("`length` must be a positive 32-bit integer"); + } + var loose = arguments.length > 2 && !!arguments[2]; + var functionLengthIsConfigurable = true; + var functionLengthIsWritable = true; + if ("length" in fn && gOPD) { + var desc = gOPD(fn, "length"); + if (desc && !desc.configurable) { + functionLengthIsConfigurable = false; + } + if (desc && !desc.writable) { + functionLengthIsWritable = false; + } + } + if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) { + if (hasDescriptors) { + define2( + /** @type {Parameters[0]} */ + fn, + "length", + length, + true, + true + ); + } else { + define2( + /** @type {Parameters[0]} */ + fn, + "length", + length + ); + } + } + return fn; + }; + } +}); + +// node_modules/.pnpm/call-bind@1.0.6/node_modules/call-bind/index.js var require_call_bind = __commonJS({ - "node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/index.js"(exports2, module2) { + "node_modules/.pnpm/call-bind@1.0.6/node_modules/call-bind/index.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var bind = require_function_bind(); var GetIntrinsic = require_get_intrinsic(); + var setFunctionLength = require_set_function_length(); + var $TypeError = require_type(); var $apply = GetIntrinsic("%Function.prototype.apply%"); var $call = GetIntrinsic("%Function.prototype.call%"); var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind.call($call, $apply); - var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true); var $defineProperty = GetIntrinsic("%Object.defineProperty%", true); var $max = GetIntrinsic("%Math.max%"); if ($defineProperty) { @@ -9421,18 +9652,15 @@ var require_call_bind = __commonJS({ } } module2.exports = function callBind(originalFunction) { - var func = $reflectApply(bind, $call, arguments); - if ($gOPD && $defineProperty) { - var desc = $gOPD(func, "length"); - if (desc.configurable) { - $defineProperty( - func, - "length", - { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } - ); - } + if (typeof originalFunction !== "function") { + throw new $TypeError("a function is required"); } - return func; + var func = $reflectApply(bind, $call, arguments); + return setFunctionLength( + func, + 1 + $max(0, originalFunction.length - (arguments.length - 1)), + true + ); }; var applyBind = function applyBind2() { return $reflectApply(bind, $apply, arguments); @@ -9445,9 +9673,9 @@ var require_call_bind = __commonJS({ } }); -// node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/callBound.js +// node_modules/.pnpm/call-bind@1.0.6/node_modules/call-bind/callBound.js var require_callBound = __commonJS({ - "node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/callBound.js"(exports2, module2) { + "node_modules/.pnpm/call-bind@1.0.6/node_modules/call-bind/callBound.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var GetIntrinsic = require_get_intrinsic(); @@ -9463,9 +9691,9 @@ var require_callBound = __commonJS({ } }); -// node_modules/.pnpm/object.assign@4.1.4/node_modules/object.assign/implementation.js +// node_modules/.pnpm/object.assign@4.1.5/node_modules/object.assign/implementation.js var require_implementation3 = __commonJS({ - "node_modules/.pnpm/object.assign@4.1.4/node_modules/object.assign/implementation.js"(exports2, module2) { + "node_modules/.pnpm/object.assign@4.1.5/node_modules/object.assign/implementation.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var objectKeys = require_object_keys(); @@ -9509,9 +9737,9 @@ var require_implementation3 = __commonJS({ } }); -// node_modules/.pnpm/object.assign@4.1.4/node_modules/object.assign/polyfill.js +// node_modules/.pnpm/object.assign@4.1.5/node_modules/object.assign/polyfill.js var require_polyfill = __commonJS({ - "node_modules/.pnpm/object.assign@4.1.4/node_modules/object.assign/polyfill.js"(exports2, module2) { + "node_modules/.pnpm/object.assign@4.1.5/node_modules/object.assign/polyfill.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var implementation = require_implementation3(); @@ -9559,9 +9787,9 @@ var require_polyfill = __commonJS({ } }); -// node_modules/.pnpm/object.assign@4.1.4/node_modules/object.assign/shim.js +// node_modules/.pnpm/object.assign@4.1.5/node_modules/object.assign/shim.js var require_shim = __commonJS({ - "node_modules/.pnpm/object.assign@4.1.4/node_modules/object.assign/shim.js"(exports2, module2) { + "node_modules/.pnpm/object.assign@4.1.5/node_modules/object.assign/shim.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var define2 = require_define_properties(); @@ -9580,9 +9808,9 @@ var require_shim = __commonJS({ } }); -// node_modules/.pnpm/object.assign@4.1.4/node_modules/object.assign/index.js +// node_modules/.pnpm/object.assign@4.1.5/node_modules/object.assign/index.js var require_object = __commonJS({ - "node_modules/.pnpm/object.assign@4.1.4/node_modules/object.assign/index.js"(exports2, module2) { + "node_modules/.pnpm/object.assign@4.1.5/node_modules/object.assign/index.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var defineProperties = require_define_properties(); @@ -9637,16 +9865,42 @@ var require_functions_have_names = __commonJS({ } }); -// node_modules/.pnpm/regexp.prototype.flags@1.5.0/node_modules/regexp.prototype.flags/implementation.js -var require_implementation4 = __commonJS({ - "node_modules/.pnpm/regexp.prototype.flags@1.5.0/node_modules/regexp.prototype.flags/implementation.js"(exports2, module2) { +// node_modules/.pnpm/set-function-name@2.0.1/node_modules/set-function-name/index.js +var require_set_function_name = __commonJS({ + "node_modules/.pnpm/set-function-name@2.0.1/node_modules/set-function-name/index.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); + var define2 = require_define_data_property(); + var hasDescriptors = require_has_property_descriptors()(); var functionsHaveConfigurableNames = require_functions_have_names().functionsHaveConfigurableNames(); - var $Object = Object; var $TypeError = TypeError; - module2.exports = function flags() { - if (this != null && this !== $Object(this)) { + module2.exports = function setFunctionName(fn, name) { + if (typeof fn !== "function") { + throw new $TypeError("`fn` is not a function"); + } + var loose = arguments.length > 2 && !!arguments[2]; + if (!loose || functionsHaveConfigurableNames) { + if (hasDescriptors) { + define2(fn, "name", name, true, true); + } else { + define2(fn, "name", name); + } + } + return fn; + }; + } +}); + +// node_modules/.pnpm/regexp.prototype.flags@1.5.2/node_modules/regexp.prototype.flags/implementation.js +var require_implementation4 = __commonJS({ + "node_modules/.pnpm/regexp.prototype.flags@1.5.2/node_modules/regexp.prototype.flags/implementation.js"(exports2, module2) { + "use strict"; + init_polyfill_buffer(); + var setFunctionName = require_set_function_name(); + var $TypeError = require_type(); + var $Object = Object; + module2.exports = setFunctionName(function flags() { + if (this == null || this !== $Object(this)) { throw new $TypeError("RegExp.prototype.flags getter called on non-object"); } var result = ""; @@ -9675,16 +9929,13 @@ var require_implementation4 = __commonJS({ result += "y"; } return result; - }; - if (functionsHaveConfigurableNames && Object.defineProperty) { - Object.defineProperty(module2.exports, "name", { value: "get flags" }); - } + }, "get flags", true); } }); -// node_modules/.pnpm/regexp.prototype.flags@1.5.0/node_modules/regexp.prototype.flags/polyfill.js +// node_modules/.pnpm/regexp.prototype.flags@1.5.2/node_modules/regexp.prototype.flags/polyfill.js var require_polyfill2 = __commonJS({ - "node_modules/.pnpm/regexp.prototype.flags@1.5.0/node_modules/regexp.prototype.flags/polyfill.js"(exports2, module2) { + "node_modules/.pnpm/regexp.prototype.flags@1.5.2/node_modules/regexp.prototype.flags/polyfill.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var implementation = require_implementation4(); @@ -9716,9 +9967,9 @@ var require_polyfill2 = __commonJS({ } }); -// node_modules/.pnpm/regexp.prototype.flags@1.5.0/node_modules/regexp.prototype.flags/shim.js +// node_modules/.pnpm/regexp.prototype.flags@1.5.2/node_modules/regexp.prototype.flags/shim.js var require_shim2 = __commonJS({ - "node_modules/.pnpm/regexp.prototype.flags@1.5.0/node_modules/regexp.prototype.flags/shim.js"(exports2, module2) { + "node_modules/.pnpm/regexp.prototype.flags@1.5.2/node_modules/regexp.prototype.flags/shim.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var supportsDescriptors = require_define_properties().supportsDescriptors; @@ -9747,9 +9998,9 @@ var require_shim2 = __commonJS({ } }); -// node_modules/.pnpm/regexp.prototype.flags@1.5.0/node_modules/regexp.prototype.flags/index.js +// node_modules/.pnpm/regexp.prototype.flags@1.5.2/node_modules/regexp.prototype.flags/index.js var require_regexp_prototype = __commonJS({ - "node_modules/.pnpm/regexp.prototype.flags@1.5.0/node_modules/regexp.prototype.flags/index.js"(exports2, module2) { + "node_modules/.pnpm/regexp.prototype.flags@1.5.2/node_modules/regexp.prototype.flags/index.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var define2 = require_define_properties(); @@ -9767,9 +10018,9 @@ var require_regexp_prototype = __commonJS({ } }); -// node_modules/.pnpm/has-tostringtag@1.0.0/node_modules/has-tostringtag/shams.js +// node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js var require_shams2 = __commonJS({ - "node_modules/.pnpm/has-tostringtag@1.0.0/node_modules/has-tostringtag/shams.js"(exports2, module2) { + "node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var hasSymbols = require_shams(); @@ -9807,16 +10058,16 @@ var require_is_arguments = __commonJS({ } }); -// (disabled):node_modules/.pnpm/object-inspect@1.12.3/node_modules/object-inspect/util.inspect +// (disabled):node_modules/.pnpm/object-inspect@1.13.1/node_modules/object-inspect/util.inspect var require_util = __commonJS({ - "(disabled):node_modules/.pnpm/object-inspect@1.12.3/node_modules/object-inspect/util.inspect"() { + "(disabled):node_modules/.pnpm/object-inspect@1.13.1/node_modules/object-inspect/util.inspect"() { init_polyfill_buffer(); } }); -// node_modules/.pnpm/object-inspect@1.12.3/node_modules/object-inspect/index.js +// node_modules/.pnpm/object-inspect@1.13.1/node_modules/object-inspect/index.js var require_object_inspect = __commonJS({ - "node_modules/.pnpm/object-inspect@1.12.3/node_modules/object-inspect/index.js"(exports2, module2) { + "node_modules/.pnpm/object-inspect@1.13.1/node_modules/object-inspect/index.js"(exports2, module2) { init_polyfill_buffer(); var hasMap = typeof Map === "function" && Map.prototype; var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null; @@ -10031,6 +10282,12 @@ var require_object_inspect = __commonJS({ if (isString(obj)) { return markBoxed(inspect(String(obj))); } + if (typeof window !== "undefined" && obj === window) { + return "{ [object Window] }"; + } + if (obj === global) { + return "{ [object globalThis] }"; + } if (!isDate(obj) && !isRegExp(obj)) { var ys = arrObjKeys(obj, inspect); var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; @@ -10324,15 +10581,15 @@ var require_object_inspect = __commonJS({ } }); -// node_modules/.pnpm/side-channel@1.0.4/node_modules/side-channel/index.js +// node_modules/.pnpm/side-channel@1.0.5/node_modules/side-channel/index.js var require_side_channel = __commonJS({ - "node_modules/.pnpm/side-channel@1.0.4/node_modules/side-channel/index.js"(exports2, module2) { + "node_modules/.pnpm/side-channel@1.0.5/node_modules/side-channel/index.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var GetIntrinsic = require_get_intrinsic(); var callBound = require_callBound(); var inspect = require_object_inspect(); - var $TypeError = GetIntrinsic("%TypeError%"); + var $TypeError = require_type(); var $WeakMap = GetIntrinsic("%WeakMap%", true); var $Map = GetIntrinsic("%Map%", true); var $weakMapGet = callBound("WeakMap.prototype.get", true); @@ -10436,15 +10693,14 @@ var require_side_channel = __commonJS({ } }); -// node_modules/.pnpm/internal-slot@1.0.5/node_modules/internal-slot/index.js +// node_modules/.pnpm/internal-slot@1.0.7/node_modules/internal-slot/index.js var require_internal_slot = __commonJS({ - "node_modules/.pnpm/internal-slot@1.0.5/node_modules/internal-slot/index.js"(exports2, module2) { + "node_modules/.pnpm/internal-slot@1.0.7/node_modules/internal-slot/index.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); - var GetIntrinsic = require_get_intrinsic(); - var has = require_src2(); + var hasOwn = require_hasown(); var channel = require_side_channel()(); - var $TypeError = GetIntrinsic("%TypeError%"); + var $TypeError = require_type(); var SLOT = { assert: function(O, slot) { if (!O || typeof O !== "object" && typeof O !== "function") { @@ -10476,7 +10732,7 @@ var require_internal_slot = __commonJS({ throw new $TypeError("`slot` must be a string"); } var slots = channel.get(O); - return !!slots && has(slots, "$" + slot); + return !!slots && hasOwn(slots, "$" + slot); }, set: function(O, slot, V) { if (!O || typeof O !== "object" && typeof O !== "function") { @@ -10896,352 +11152,19 @@ var require_object_is = __commonJS({ } }); -// node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js -var require_is_callable = __commonJS({ - "node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var fnToStr = Function.prototype.toString; - var reflectApply = typeof Reflect === "object" && Reflect !== null && Reflect.apply; - var badArrayLike; - var isCallableMarker; - if (typeof reflectApply === "function" && typeof Object.defineProperty === "function") { - try { - badArrayLike = Object.defineProperty({}, "length", { - get: function() { - throw isCallableMarker; - } - }); - isCallableMarker = {}; - reflectApply(function() { - throw 42; - }, null, badArrayLike); - } catch (_) { - if (_ !== isCallableMarker) { - reflectApply = null; - } - } - } else { - reflectApply = null; - } - var constructorRegex = /^\s*class\b/; - var isES6ClassFn = function isES6ClassFunction(value) { - try { - var fnStr = fnToStr.call(value); - return constructorRegex.test(fnStr); - } catch (e) { - return false; - } - }; - var tryFunctionObject = function tryFunctionToStr(value) { - try { - if (isES6ClassFn(value)) { - return false; - } - fnToStr.call(value); - return true; - } catch (e) { - return false; - } - }; - var toStr = Object.prototype.toString; - var objectClass = "[object Object]"; - var fnClass = "[object Function]"; - var genClass = "[object GeneratorFunction]"; - var ddaClass = "[object HTMLAllCollection]"; - var ddaClass2 = "[object HTML document.all class]"; - var ddaClass3 = "[object HTMLCollection]"; - var hasToStringTag = typeof Symbol === "function" && !!Symbol.toStringTag; - var isIE68 = !(0 in [,]); - var isDDA = function isDocumentDotAll() { - return false; - }; - if (typeof document === "object") { - all = document.all; - if (toStr.call(all) === toStr.call(document.all)) { - isDDA = function isDocumentDotAll(value) { - if ((isIE68 || !value) && (typeof value === "undefined" || typeof value === "object")) { - try { - var str = toStr.call(value); - return (str === ddaClass || str === ddaClass2 || str === ddaClass3 || str === objectClass) && value("") == null; - } catch (e) { - } - } - return false; - }; - } - } - var all; - module2.exports = reflectApply ? function isCallable(value) { - if (isDDA(value)) { - return true; - } - if (!value) { - return false; - } - if (typeof value !== "function" && typeof value !== "object") { - return false; - } - try { - reflectApply(value, null, badArrayLike); - } catch (e) { - if (e !== isCallableMarker) { - return false; - } - } - return !isES6ClassFn(value) && tryFunctionObject(value); - } : function isCallable(value) { - if (isDDA(value)) { - return true; - } - if (!value) { - return false; - } - if (typeof value !== "function" && typeof value !== "object") { - return false; - } - if (hasToStringTag) { - return tryFunctionObject(value); - } - if (isES6ClassFn(value)) { - return false; - } - var strClass = toStr.call(value); - if (strClass !== fnClass && strClass !== genClass && !/^\[object HTML/.test(strClass)) { - return false; - } - return tryFunctionObject(value); - }; - } -}); - -// node_modules/.pnpm/for-each@0.3.3/node_modules/for-each/index.js -var require_for_each = __commonJS({ - "node_modules/.pnpm/for-each@0.3.3/node_modules/for-each/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var isCallable = require_is_callable(); - var toStr = Object.prototype.toString; - var hasOwnProperty = Object.prototype.hasOwnProperty; - var forEachArray = function forEachArray2(array, iterator, receiver) { - for (var i = 0, len = array.length; i < len; i++) { - if (hasOwnProperty.call(array, i)) { - if (receiver == null) { - iterator(array[i], i, array); - } else { - iterator.call(receiver, array[i], i, array); - } - } - } - }; - var forEachString = function forEachString2(string, iterator, receiver) { - for (var i = 0, len = string.length; i < len; i++) { - if (receiver == null) { - iterator(string.charAt(i), i, string); - } else { - iterator.call(receiver, string.charAt(i), i, string); - } - } - }; - var forEachObject = function forEachObject2(object, iterator, receiver) { - for (var k in object) { - if (hasOwnProperty.call(object, k)) { - if (receiver == null) { - iterator(object[k], k, object); - } else { - iterator.call(receiver, object[k], k, object); - } - } - } - }; - var forEach2 = function forEach3(list, iterator, thisArg) { - if (!isCallable(iterator)) { - throw new TypeError("iterator must be a function"); - } - var receiver; - if (arguments.length >= 3) { - receiver = thisArg; - } - if (toStr.call(list) === "[object Array]") { - forEachArray(list, iterator, receiver); - } else if (typeof list === "string") { - forEachString(list, iterator, receiver); - } else { - forEachObject(list, iterator, receiver); - } - }; - module2.exports = forEach2; - } -}); - -// node_modules/.pnpm/available-typed-arrays@1.0.5/node_modules/available-typed-arrays/index.js -var require_available_typed_arrays = __commonJS({ - "node_modules/.pnpm/available-typed-arrays@1.0.5/node_modules/available-typed-arrays/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var possibleNames = [ - "BigInt64Array", - "BigUint64Array", - "Float32Array", - "Float64Array", - "Int16Array", - "Int32Array", - "Int8Array", - "Uint16Array", - "Uint32Array", - "Uint8Array", - "Uint8ClampedArray" - ]; - var g = typeof globalThis === "undefined" ? global : globalThis; - module2.exports = function availableTypedArrays() { - var out = []; - for (var i = 0; i < possibleNames.length; i++) { - if (typeof g[possibleNames[i]] === "function") { - out[out.length] = possibleNames[i]; - } - } - return out; - }; - } -}); - -// node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.js -var require_gopd = __commonJS({ - "node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var GetIntrinsic = require_get_intrinsic(); - var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true); - if ($gOPD) { - try { - $gOPD([], "length"); - } catch (e) { - $gOPD = null; - } - } - module2.exports = $gOPD; - } -}); - -// node_modules/.pnpm/which-typed-array@1.1.11/node_modules/which-typed-array/index.js -var require_which_typed_array = __commonJS({ - "node_modules/.pnpm/which-typed-array@1.1.11/node_modules/which-typed-array/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var forEach2 = require_for_each(); - var availableTypedArrays = require_available_typed_arrays(); - var callBind = require_call_bind(); - var callBound = require_callBound(); - var gOPD = require_gopd(); - var $toString = callBound("Object.prototype.toString"); - var hasToStringTag = require_shams2()(); - var g = typeof globalThis === "undefined" ? global : globalThis; - var typedArrays = availableTypedArrays(); - var $slice = callBound("String.prototype.slice"); - var getPrototypeOf = Object.getPrototypeOf; - var $indexOf = callBound("Array.prototype.indexOf", true) || function indexOf(array, value) { - for (var i = 0; i < array.length; i += 1) { - if (array[i] === value) { - return i; - } - } - return -1; - }; - var cache = { __proto__: null }; - if (hasToStringTag && gOPD && getPrototypeOf) { - forEach2(typedArrays, function(typedArray) { - var arr = new g[typedArray](); - if (Symbol.toStringTag in arr) { - var proto = getPrototypeOf(arr); - var descriptor = gOPD(proto, Symbol.toStringTag); - if (!descriptor) { - var superProto = getPrototypeOf(proto); - descriptor = gOPD(superProto, Symbol.toStringTag); - } - cache["$" + typedArray] = callBind(descriptor.get); - } - }); - } else { - forEach2(typedArrays, function(typedArray) { - var arr = new g[typedArray](); - cache["$" + typedArray] = callBind(arr.slice); - }); - } - var tryTypedArrays = function tryAllTypedArrays(value) { - var found = false; - forEach2(cache, function(getter, typedArray) { - if (!found) { - try { - if ("$" + getter(value) === typedArray) { - found = $slice(typedArray, 1); - } - } catch (e) { - } - } - }); - return found; - }; - var trySlices = function tryAllSlices(value) { - var found = false; - forEach2(cache, function(getter, name) { - if (!found) { - try { - getter(value); - found = $slice(name, 1); - } catch (e) { - } - } - }); - return found; - }; - module2.exports = function whichTypedArray(value) { - if (!value || typeof value !== "object") { - return false; - } - if (!hasToStringTag) { - var tag2 = $slice($toString(value), 8, -1); - if ($indexOf(typedArrays, tag2) > -1) { - return tag2; - } - if (tag2 !== "Object") { - return false; - } - return trySlices(value); - } - if (!gOPD) { - return null; - } - return tryTypedArrays(value); - }; - } -}); - -// node_modules/.pnpm/is-typed-array@1.1.12/node_modules/is-typed-array/index.js -var require_is_typed_array = __commonJS({ - "node_modules/.pnpm/is-typed-array@1.1.12/node_modules/is-typed-array/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var whichTypedArray = require_which_typed_array(); - module2.exports = function isTypedArray(value) { - return !!whichTypedArray(value); - }; - } -}); - -// node_modules/.pnpm/is-array-buffer@3.0.2/node_modules/is-array-buffer/index.js +// node_modules/.pnpm/is-array-buffer@3.0.4/node_modules/is-array-buffer/index.js var require_is_array_buffer = __commonJS({ - "node_modules/.pnpm/is-array-buffer@3.0.2/node_modules/is-array-buffer/index.js"(exports2, module2) { + "node_modules/.pnpm/is-array-buffer@3.0.4/node_modules/is-array-buffer/index.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var callBind = require_call_bind(); var callBound = require_callBound(); var GetIntrinsic = require_get_intrinsic(); - var isTypedArray = require_is_typed_array(); - var $ArrayBuffer = GetIntrinsic("ArrayBuffer", true); - var $Float32Array = GetIntrinsic("Float32Array", true); + var $ArrayBuffer = GetIntrinsic("%ArrayBuffer%", true); var $byteLength = callBound("ArrayBuffer.prototype.byteLength", true); - var abSlice = $ArrayBuffer && !$byteLength && new $ArrayBuffer().slice; - var $abSlice = abSlice && callBind(abSlice); + var $toString = callBound("Object.prototype.toString"); + var abSlice = !!$ArrayBuffer && !$byteLength && new $ArrayBuffer(0).slice; + var $abSlice = !!abSlice && callBind(abSlice); module2.exports = $byteLength || $abSlice ? function isArrayBuffer(obj) { if (!obj || typeof obj !== "object") { return false; @@ -11256,12 +11179,8 @@ var require_is_array_buffer = __commonJS({ } catch (e) { return false; } - } : $Float32Array ? function IsArrayBuffer(obj) { - try { - return new $Float32Array(obj).buffer === obj && !isTypedArray(obj); - } catch (e) { - return typeof obj === "object" && e.name === "RangeError"; - } + } : $ArrayBuffer ? function isArrayBuffer(obj) { + return $toString(obj) === "[object ArrayBuffer]"; } : function isArrayBuffer(obj) { return false; }; @@ -11657,9 +11576,328 @@ var require_which_collection = __commonJS({ } }); -// node_modules/.pnpm/array-buffer-byte-length@1.0.0/node_modules/array-buffer-byte-length/index.js +// node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js +var require_is_callable = __commonJS({ + "node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js"(exports2, module2) { + "use strict"; + init_polyfill_buffer(); + var fnToStr = Function.prototype.toString; + var reflectApply = typeof Reflect === "object" && Reflect !== null && Reflect.apply; + var badArrayLike; + var isCallableMarker; + if (typeof reflectApply === "function" && typeof Object.defineProperty === "function") { + try { + badArrayLike = Object.defineProperty({}, "length", { + get: function() { + throw isCallableMarker; + } + }); + isCallableMarker = {}; + reflectApply(function() { + throw 42; + }, null, badArrayLike); + } catch (_) { + if (_ !== isCallableMarker) { + reflectApply = null; + } + } + } else { + reflectApply = null; + } + var constructorRegex = /^\s*class\b/; + var isES6ClassFn = function isES6ClassFunction(value) { + try { + var fnStr = fnToStr.call(value); + return constructorRegex.test(fnStr); + } catch (e) { + return false; + } + }; + var tryFunctionObject = function tryFunctionToStr(value) { + try { + if (isES6ClassFn(value)) { + return false; + } + fnToStr.call(value); + return true; + } catch (e) { + return false; + } + }; + var toStr = Object.prototype.toString; + var objectClass = "[object Object]"; + var fnClass = "[object Function]"; + var genClass = "[object GeneratorFunction]"; + var ddaClass = "[object HTMLAllCollection]"; + var ddaClass2 = "[object HTML document.all class]"; + var ddaClass3 = "[object HTMLCollection]"; + var hasToStringTag = typeof Symbol === "function" && !!Symbol.toStringTag; + var isIE68 = !(0 in [,]); + var isDDA = function isDocumentDotAll() { + return false; + }; + if (typeof document === "object") { + all = document.all; + if (toStr.call(all) === toStr.call(document.all)) { + isDDA = function isDocumentDotAll(value) { + if ((isIE68 || !value) && (typeof value === "undefined" || typeof value === "object")) { + try { + var str = toStr.call(value); + return (str === ddaClass || str === ddaClass2 || str === ddaClass3 || str === objectClass) && value("") == null; + } catch (e) { + } + } + return false; + }; + } + } + var all; + module2.exports = reflectApply ? function isCallable(value) { + if (isDDA(value)) { + return true; + } + if (!value) { + return false; + } + if (typeof value !== "function" && typeof value !== "object") { + return false; + } + try { + reflectApply(value, null, badArrayLike); + } catch (e) { + if (e !== isCallableMarker) { + return false; + } + } + return !isES6ClassFn(value) && tryFunctionObject(value); + } : function isCallable(value) { + if (isDDA(value)) { + return true; + } + if (!value) { + return false; + } + if (typeof value !== "function" && typeof value !== "object") { + return false; + } + if (hasToStringTag) { + return tryFunctionObject(value); + } + if (isES6ClassFn(value)) { + return false; + } + var strClass = toStr.call(value); + if (strClass !== fnClass && strClass !== genClass && !/^\[object HTML/.test(strClass)) { + return false; + } + return tryFunctionObject(value); + }; + } +}); + +// node_modules/.pnpm/for-each@0.3.3/node_modules/for-each/index.js +var require_for_each = __commonJS({ + "node_modules/.pnpm/for-each@0.3.3/node_modules/for-each/index.js"(exports2, module2) { + "use strict"; + init_polyfill_buffer(); + var isCallable = require_is_callable(); + var toStr = Object.prototype.toString; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var forEachArray = function forEachArray2(array, iterator, receiver) { + for (var i = 0, len = array.length; i < len; i++) { + if (hasOwnProperty.call(array, i)) { + if (receiver == null) { + iterator(array[i], i, array); + } else { + iterator.call(receiver, array[i], i, array); + } + } + } + }; + var forEachString = function forEachString2(string, iterator, receiver) { + for (var i = 0, len = string.length; i < len; i++) { + if (receiver == null) { + iterator(string.charAt(i), i, string); + } else { + iterator.call(receiver, string.charAt(i), i, string); + } + } + }; + var forEachObject = function forEachObject2(object, iterator, receiver) { + for (var k in object) { + if (hasOwnProperty.call(object, k)) { + if (receiver == null) { + iterator(object[k], k, object); + } else { + iterator.call(receiver, object[k], k, object); + } + } + } + }; + var forEach2 = function forEach3(list, iterator, thisArg) { + if (!isCallable(iterator)) { + throw new TypeError("iterator must be a function"); + } + var receiver; + if (arguments.length >= 3) { + receiver = thisArg; + } + if (toStr.call(list) === "[object Array]") { + forEachArray(list, iterator, receiver); + } else if (typeof list === "string") { + forEachString(list, iterator, receiver); + } else { + forEachObject(list, iterator, receiver); + } + }; + module2.exports = forEach2; + } +}); + +// node_modules/.pnpm/available-typed-arrays@1.0.6/node_modules/available-typed-arrays/index.js +var require_available_typed_arrays = __commonJS({ + "node_modules/.pnpm/available-typed-arrays@1.0.6/node_modules/available-typed-arrays/index.js"(exports2, module2) { + "use strict"; + init_polyfill_buffer(); + var possibleNames = [ + "BigInt64Array", + "BigUint64Array", + "Float32Array", + "Float64Array", + "Int16Array", + "Int32Array", + "Int8Array", + "Uint16Array", + "Uint32Array", + "Uint8Array", + "Uint8ClampedArray" + ]; + var g = typeof globalThis === "undefined" ? global : globalThis; + module2.exports = function availableTypedArrays() { + var out = []; + for (var i = 0; i < possibleNames.length; i++) { + if (typeof g[possibleNames[i]] === "function") { + out[out.length] = possibleNames[i]; + } + } + return out; + }; + } +}); + +// node_modules/.pnpm/which-typed-array@1.1.14/node_modules/which-typed-array/index.js +var require_which_typed_array = __commonJS({ + "node_modules/.pnpm/which-typed-array@1.1.14/node_modules/which-typed-array/index.js"(exports2, module2) { + "use strict"; + init_polyfill_buffer(); + var forEach2 = require_for_each(); + var availableTypedArrays = require_available_typed_arrays(); + var callBind = require_call_bind(); + var callBound = require_callBound(); + var gOPD = require_gopd(); + var $toString = callBound("Object.prototype.toString"); + var hasToStringTag = require_shams2()(); + var g = typeof globalThis === "undefined" ? global : globalThis; + var typedArrays = availableTypedArrays(); + var $slice = callBound("String.prototype.slice"); + var getPrototypeOf = Object.getPrototypeOf; + var $indexOf = callBound("Array.prototype.indexOf", true) || /** @type {(array: readonly unknown[], value: unknown) => keyof array} */ + function indexOf(array, value) { + for (var i = 0; i < array.length; i += 1) { + if (array[i] === value) { + return i; + } + } + return -1; + }; + var cache = { __proto__: null }; + if (hasToStringTag && gOPD && getPrototypeOf) { + forEach2(typedArrays, function(typedArray) { + var arr = new g[typedArray](); + if (Symbol.toStringTag in arr) { + var proto = getPrototypeOf(arr); + var descriptor = gOPD(proto, Symbol.toStringTag); + if (!descriptor) { + var superProto = getPrototypeOf(proto); + descriptor = gOPD(superProto, Symbol.toStringTag); + } + cache["$" + typedArray] = callBind(descriptor.get); + } + }); + } else { + forEach2(typedArrays, function(typedArray) { + var arr = new g[typedArray](); + var fn = arr.slice || arr.set; + if (fn) { + cache["$" + typedArray] = callBind(fn); + } + }); + } + var tryTypedArrays = function tryAllTypedArrays(value) { + var found = false; + forEach2( + // eslint-disable-next-line no-extra-parens + /** @type {Record<`\$${TypedArrayName}`, typeof cache>} */ + /** @type {any} */ + cache, + /** @type {(getter: typeof cache, name: `\$${TypedArrayName}`) => void} */ + function(getter, typedArray) { + if (!found) { + try { + if ("$" + getter(value) === typedArray) { + found = $slice(typedArray, 1); + } + } catch (e) { + } + } + } + ); + return found; + }; + var trySlices = function tryAllSlices(value) { + var found = false; + forEach2( + // eslint-disable-next-line no-extra-parens + /** @type {any} */ + cache, + /** @type {(getter: typeof cache, name: `\$${TypedArrayName}`) => void} */ + function(getter, name) { + if (!found) { + try { + getter(value); + found = $slice(name, 1); + } catch (e) { + } + } + } + ); + return found; + }; + module2.exports = function whichTypedArray(value) { + if (!value || typeof value !== "object") { + return false; + } + if (!hasToStringTag) { + var tag2 = $slice($toString(value), 8, -1); + if ($indexOf(typedArrays, tag2) > -1) { + return tag2; + } + if (tag2 !== "Object") { + return false; + } + return trySlices(value); + } + if (!gOPD) { + return null; + } + return tryTypedArrays(value); + }; + } +}); + +// node_modules/.pnpm/array-buffer-byte-length@1.0.1/node_modules/array-buffer-byte-length/index.js var require_array_buffer_byte_length = __commonJS({ - "node_modules/.pnpm/array-buffer-byte-length@1.0.0/node_modules/array-buffer-byte-length/index.js"(exports2, module2) { + "node_modules/.pnpm/array-buffer-byte-length@1.0.1/node_modules/array-buffer-byte-length/index.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var callBound = require_callBound(); @@ -11674,9 +11912,9 @@ var require_array_buffer_byte_length = __commonJS({ } }); -// node_modules/.pnpm/deep-equal@2.2.2/node_modules/deep-equal/index.js +// node_modules/.pnpm/deep-equal@2.2.3/node_modules/deep-equal/index.js var require_deep_equal = __commonJS({ - "node_modules/.pnpm/deep-equal@2.2.2/node_modules/deep-equal/index.js"(exports2, module2) { + "node_modules/.pnpm/deep-equal@2.2.3/node_modules/deep-equal/index.js"(exports2, module2) { "use strict"; init_polyfill_buffer(); var assign2 = require_object(); @@ -12915,7 +13153,7 @@ var require_template = __commonJS({ v: hoganEscape, // triple stache t: coerceToString, - render: function render2(context, partials, indent2) { + render: function render(context, partials, indent2) { return this.ri([context], partials || {}, indent2); }, // render internal -- a hook for overrides that catches partials too @@ -13654,7 +13892,7 @@ var require_feather = __commonJS({ "./node_modules/core-js/internals/well-known-symbol.js" ); var TO_STRING_TAG = wellKnownSymbol("toStringTag"); - var CORRECT_ARGUMENTS = classofRaw(function() { + var CORRECT_ARGUMENTS = classofRaw(/* @__PURE__ */ function() { return arguments; }()) == "Arguments"; var tryGet = function(it, key2) { @@ -15468,7 +15706,7 @@ var require_feather = __commonJS({ /***/ function(module3, exports3) { var g; - g = function() { + g = /* @__PURE__ */ function() { return this; }(); try { @@ -15514,7 +15752,7 @@ var require_feather = __commonJS({ } return target; }; - var _createClass = function() { + var _createClass = /* @__PURE__ */ function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; @@ -15802,7 +16040,7 @@ __export(main_exports, { module.exports = __toCommonJS(main_exports); init_polyfill_buffer(); -// node_modules/.pnpm/isomorphic-git@1.24.5/node_modules/isomorphic-git/index.js +// node_modules/.pnpm/isomorphic-git@1.25.3/node_modules/isomorphic-git/index.js init_polyfill_buffer(); var import_async_lock = __toESM(require_async_lock(), 1); var import_sha1 = __toESM(require_sha1(), 1); @@ -16713,8 +16951,30 @@ function compareRefNames(a, b) { } return tmp; } +var memo = /* @__PURE__ */ new Map(); function normalizePath(path2) { - return path2.replace(/\/\.\//g, "/").replace(/\/{2,}/g, "/").replace(/^\/\.$/, "/").replace(/^\.\/$/, ".").replace(/^\.\//, "").replace(/\/\.$/, "").replace(/(.+)\/$/, "$1").replace(/^$/, "."); + let normalizedPath = memo.get(path2); + if (!normalizedPath) { + normalizedPath = normalizePathInternal(path2); + memo.set(path2, normalizedPath); + } + return normalizedPath; +} +function normalizePathInternal(path2) { + path2 = path2.split("/./").join("/").replace(/\/{2,}/g, "/"); + if (path2 === "/.") + return "/"; + if (path2 === "./") + return "."; + if (path2.startsWith("./")) + path2 = path2.slice(2); + if (path2.endsWith("/.")) + path2 = path2.slice(0, -2); + if (path2.length > 1 && path2.endsWith("/")) + path2 = path2.slice(0, -1); + if (path2 === "") + return "."; + return path2; } function join(...parts) { return normalizePath(parts.map(normalizePath).join("/")); @@ -17539,6 +17799,8 @@ var StreamReader = class { let { done, value } = await this.stream.next(); if (done) { this._ended = true; + if (!value) + return Buffer.alloc(0); } if (value) { value = Buffer.from(value); @@ -18248,13 +18510,16 @@ MergeNotSupportedError.code = "MergeNotSupportedError"; var MergeConflictError = class _MergeConflictError extends BaseError { /** * @param {Array} filepaths + * @param {Array} bothModified + * @param {Array} deleteByUs + * @param {Array} deleteByTheirs */ - constructor(filepaths) { + constructor(filepaths, bothModified, deleteByUs, deleteByTheirs) { super( `Automatic merge failed with one or more merge conflicts in the following files: ${filepaths.toString()}. Fix conflicts then commit the result.` ); this.code = this.name = _MergeConflictError.code; - this.data = { filepaths }; + this.data = { filepaths, bothModified, deleteByUs, deleteByTheirs }; } }; MergeConflictError.code = "MergeConflictError"; @@ -20799,7 +21064,7 @@ var GitPktLine = class { return true; return buffer2; } catch (err) { - console.log("error", err); + stream.error = err; return true; } }; @@ -21174,8 +21439,8 @@ function filterCapabilities(server, client) { } var pkg = { name: "isomorphic-git", - version: "1.24.5", - agent: "git/isomorphic-git@1.24.5" + version: "1.25.3", + agent: "git/isomorphic-git@1.25.3" }; var FIFO = class { constructor() { @@ -21202,8 +21467,8 @@ var FIFO = class { } } destroy(err) { - this._ended = true; this.error = err; + this.end(); } async next() { if (this._queue.length > 0) { @@ -21270,7 +21535,7 @@ var GitSideBand = class { if (line === true) { packetlines.end(); progress.end(); - packfile.end(); + input.error ? packfile.destroy(input.error) : packfile.end(); return; } switch (line[0]) { @@ -21285,11 +21550,13 @@ var GitSideBand = class { case 3: { const error = line.slice(1); progress.write(error); + packetlines.end(); + progress.end(); packfile.destroy(new Error(error.toString("utf8"))); return; } default: { - packetlines.write(line.slice(0)); + packetlines.write(line); } } nextBit(); @@ -21399,9 +21666,16 @@ async function parseUploadPackResponse(stream) { } else if (line.startsWith("NAK")) { nak = true; done = true; + } else { + done = true; + nak = true; } if (done) { - resolve({ shallows, unshallows, acks, nak, packfile, progress }); + stream.error ? reject(stream.error) : resolve({ shallows, unshallows, acks, nak, packfile, progress }); + } + }).finally(() => { + if (!done) { + stream.error ? reject(stream.error) : resolve({ shallows, unshallows, acks, nak, packfile, progress }); } }); }); @@ -21690,6 +21964,8 @@ async function _fetch({ }); } const packfile = Buffer.from(await collect(response.packfile)); + if (raw.body.error) + throw raw.body.error; const packfileSha = packfile.slice(-20).toString("hex"); const res = { defaultBranch: response.HEAD, @@ -22220,6 +22496,9 @@ async function mergeTree({ const baseTree = TREE({ ref: baseOid }); const theirTree = TREE({ ref: theirOid }); const unmergedFiles = []; + const bothModified = []; + const deleteByUs = []; + const deleteByTheirs = []; const results = await _walk({ fs, cache, @@ -22271,6 +22550,7 @@ async function mergeTree({ }).then(async (r) => { if (!r.cleanMerge) { unmergedFiles.push(filepath); + bothModified.push(filepath); if (!abortOnConflict) { const baseOid2 = await base.oid(); const ourOid2 = await ours.oid(); @@ -22286,6 +22566,43 @@ async function mergeTree({ return r.mergeResult; }); } + if (base && !ours && theirs && await base.type() === "blob" && await theirs.type() === "blob") { + unmergedFiles.push(filepath); + deleteByUs.push(filepath); + if (!abortOnConflict) { + const baseOid2 = await base.oid(); + const theirOid2 = await theirs.oid(); + index2.delete({ filepath }); + index2.insert({ filepath, oid: baseOid2, stage: 1 }); + index2.insert({ filepath, oid: theirOid2, stage: 3 }); + } + return { + mode: await theirs.mode(), + oid: await theirs.oid(), + type: "blob", + path: path2 + }; + } + if (base && ours && !theirs && await base.type() === "blob" && await ours.type() === "blob") { + unmergedFiles.push(filepath); + deleteByTheirs.push(filepath); + if (!abortOnConflict) { + const baseOid2 = await base.oid(); + const ourOid2 = await ours.oid(); + index2.delete({ filepath }); + index2.insert({ filepath, oid: baseOid2, stage: 1 }); + index2.insert({ filepath, oid: ourOid2, stage: 2 }); + } + return { + mode: await ours.mode(), + oid: await ours.oid(), + type: "blob", + path: path2 + }; + } + if (base && !ours && !theirs && await base.type() === "blob") { + return void 0; + } throw new MergeNotSupportedError(); } } @@ -22334,7 +22651,12 @@ async function mergeTree({ } }); } - return new MergeConflictError(unmergedFiles); + return new MergeConflictError( + unmergedFiles, + bothModified, + deleteByUs, + deleteByTheirs + ); } return results.oid; } @@ -25403,7 +25725,7 @@ var index = { var isomorphic_git_default = index; // src/main.ts -var import_obsidian30 = require("obsidian"); +var import_obsidian31 = require("obsidian"); // src/lineAuthor/lineAuthorIntegration.ts init_polyfill_buffer(); @@ -28014,7 +28336,7 @@ var init_scheduler = __esm2({ "src/lib/runners/scheduler.ts"() { init_utils(); init_git_logger(); - createScheduledTask = (() => { + createScheduledTask = /* @__PURE__ */ (() => { let id = 0; return () => { id++; @@ -28607,9 +28929,9 @@ var init_TagList = __esm2({ return singleSorted(toNumber(partsA[0]), toNumber(partsB[0])); } for (let i = 0, l = Math.max(partsA.length, partsB.length); i < l; i++) { - const diff2 = sorted(toNumber(partsA[i]), toNumber(partsB[i])); - if (diff2) { - return diff2; + const diff3 = sorted(toNumber(partsA[i]), toNumber(partsB[i])); + if (diff3) { + return diff3; } } return 0; @@ -29274,6 +29596,7 @@ var DEFAULT_SETTINGS = { disablePush: false, pullBeforePush: true, disablePopups: false, + disablePopupsForNoChanges: false, listChangedFilesInMessageBody: false, showStatusBar: true, updateSubmodules: false, @@ -29292,6 +29615,8 @@ var DEFAULT_SETTINGS = { submoduleRecurseCheckout: false, gitDir: "", showFileMenu: true, + authorInHistoryView: "hide", + dateInHistoryView: false, lineAuthor: { show: false, followMovement: "inactive", @@ -29430,15 +29755,24 @@ var GitManager = class { this.plugin = plugin; this.app = plugin.app; } - getVaultPath(path2) { + // Constructs a path relative to the vault from a path relative to the git repository + getRelativeVaultPath(path2) { if (this.plugin.settings.basePath) { return this.plugin.settings.basePath + "/" + path2; } else { return path2; } } - asRepositoryRelativePath(path2, relativeToVault) { - return relativeToVault && this.plugin.settings.basePath.length > 0 ? path2.substring(this.plugin.settings.basePath.length + 1) : path2; + // Constructs a path relative to the git repository from a path relative to the vault + // + // @param doConversion - If false, the path is returned as is. This is added because that parameter is often passed on to functions where this method is called. + getRelativeRepoPath(path2, doConversion = true) { + if (doConversion) { + if (this.plugin.settings.basePath.length > 0) { + return path2.substring(this.plugin.settings.basePath.length + 1); + } + } + return path2; } _getTreeStructure(children2, beginLength = 0) { const list = []; @@ -29459,7 +29793,7 @@ var GitManager = class { list.push({ title, path: path2, - vaultPath: this.getVaultPath(path2), + vaultPath: this.getRelativeVaultPath(path2), children: this._getTreeStructure( childrenWithSameTitle, (beginLength > 0 ? beginLength + title.length : title.length) + 1 @@ -29470,7 +29804,7 @@ var GitManager = class { title: restPath, data: first2, path: first2.path, - vaultPath: this.getVaultPath(first2.path) + vaultPath: this.getRelativeVaultPath(first2.path) }); children2.remove(first2); } @@ -29550,10 +29884,10 @@ var GitManager = class { const files = chunks.join(", "); template = template.replace("{{files}}", files); } - const moment5 = window.moment; + const moment6 = window.moment; template = template.replace( "{{date}}", - moment5().format(this.plugin.settings.commitDateFormat) + moment6().format(this.plugin.settings.commitDateFormat) ); if (this.plugin.settings.listChangedFilesInMessageBody) { template = template + "\n\nAffected files:\n" + (status2 != null ? status2 : await this.status()).staged.map((e) => e.path).join("\n"); @@ -29611,32 +29945,29 @@ var SimpleGit = class extends GitManager { this.plugin.setState(1 /* status */); const status2 = await this.git.status((err) => this.onError(err)); this.plugin.setState(0 /* idle */); + const allFilesFormatted = status2.files.map((e) => { + const res = this.formatPath(e); + return { + path: res.path, + from: res.from, + index: e.index === "?" ? "U" : e.index, + working_dir: e.working_dir === "?" ? "U" : e.working_dir, + vault_path: this.getRelativeVaultPath(res.path) + }; + }); return { - changed: status2.files.filter((e) => e.working_dir !== " ").map((e) => { - const res = this.formatPath(e); - return { - path: res.path, - from: res.from, - working_dir: e.working_dir === "?" ? "U" : e.working_dir, - vault_path: this.getVaultPath(res.path) - }; - }), - staged: status2.files.filter((e) => e.index !== " " && e.index != "?").map((e) => { - const res = this.formatPath(e, e.index === "R"); - return { - path: res.path, - from: res.from, - index: e.index, - vault_path: this.getVaultPath(res.path) - }; - }), + all: allFilesFormatted, + changed: allFilesFormatted.filter((e) => e.working_dir !== " "), + staged: allFilesFormatted.filter( + (e) => e.index !== " " && e.index != "U" + ), conflicted: status2.conflicted.map( (path2) => this.formatPath({ path: path2 }).path ) }; } async submoduleAwareHeadRevisonInContainingDirectory(filepath) { - const repoPath = this.asRepositoryRelativePath(filepath, true); + const repoPath = this.getRelativeRepoPath(filepath); const containingDirectory = path.dirname(repoPath); const args = ["-C", containingDirectory, "rev-parse", "HEAD"]; const result = this.git.raw(args); @@ -29696,7 +30027,7 @@ var SimpleGit = class extends GitManager { } } async blame(path2, trackMovement, ignoreWhitespace) { - path2 = this.asRepositoryRelativePath(path2, true); + path2 = this.getRelativeRepoPath(path2); if (!await this.isTracked(path2)) return "untracked"; const inSubmodule = await this.getSubmoduleOfFile(path2); @@ -29754,10 +30085,14 @@ var SimpleGit = class extends GitManager { dispatchEvent(new CustomEvent("git-head-update")); return res.summary.changes; } - async commit(message) { + async commit({ + message, + amend + }) { this.plugin.setState(4 /* commit */); const res = (await this.git.commit( await this.formatCommitMessage(message), + amend ? ["--amend"] : [], (err) => this.onError(err) )).summary.changes; dispatchEvent(new CustomEvent("git-head-update")); @@ -29766,7 +30101,7 @@ var SimpleGit = class extends GitManager { } async stage(path2, relativeToVault) { this.plugin.setState(3 /* add */); - path2 = this.asRepositoryRelativePath(path2, relativeToVault); + path2 = this.getRelativeRepoPath(path2, relativeToVault); await this.git.add(["--", path2], (err) => this.onError(err)); this.plugin.setState(0 /* idle */); } @@ -29785,7 +30120,7 @@ var SimpleGit = class extends GitManager { } async unstage(path2, relativeToVault) { this.plugin.setState(3 /* add */); - path2 = this.asRepositoryRelativePath(path2, relativeToVault); + path2 = this.getRelativeRepoPath(path2, relativeToVault); await this.git.reset(["--", path2], (err) => this.onError(err)); this.plugin.setState(0 /* idle */); } @@ -29795,7 +30130,7 @@ var SimpleGit = class extends GitManager { this.plugin.setState(0 /* idle */); } async hashObject(filepath) { - filepath = this.asRepositoryRelativePath(filepath, true); + filepath = this.getRelativeRepoPath(filepath); const inSubmodule = await this.getSubmoduleOfFile(filepath); const args = inSubmodule ? ["-C", inSubmodule.submodule] : []; const relativeFilepath = inSubmodule ? inSubmodule.relativeFilepath : filepath; @@ -29821,6 +30156,12 @@ var SimpleGit = class extends GitManager { [branchInfo.current], (err) => this.onError(err) ); + if (!branchInfo.tracking && this.plugin.settings.updateSubmodules) { + this.plugin.log( + "No tracking branch found. Ignoring pull of main repo and updating submodules only." + ); + return; + } await this.git.fetch((err) => this.onError(err)); const upstreamCommit = await this.git.revparse( [branchInfo.tracking], @@ -29872,7 +30213,7 @@ var SimpleGit = class extends GitManager { return { path: e, working_dir: "P", - vault_path: this.getVaultPath(e) + vault_path: this.getRelativeVaultPath(e) }; }); } else { @@ -29880,17 +30221,9 @@ var SimpleGit = class extends GitManager { } } async push() { - this.plugin.setState(1 /* status */); - const status2 = await this.git.status(); - const trackingBranch = status2.tracking; - const currentBranch2 = status2.current; - const remoteChangedFiles = (await this.git.diffSummary( - [currentBranch2, trackingBranch, "--"], - (err) => this.onError(err) - )).changed; this.plugin.setState(5 /* push */); if (this.plugin.settings.updateSubmodules) { - await this.git.env({ ...process.env, OBSIDIAN_GIT: 1 }).subModule( + const res = await this.git.env({ ...process.env, OBSIDIAN_GIT: 1 }).subModule( [ "foreach", "--recursive", @@ -29898,7 +30231,21 @@ var SimpleGit = class extends GitManager { ], (err) => this.onError(err) ); + console.log(res); } + const status2 = await this.git.status(); + const trackingBranch = status2.tracking; + const currentBranch2 = status2.current; + if (!trackingBranch && this.plugin.settings.updateSubmodules) { + this.plugin.log( + "No tracking branch found. Ignoring push of main repo and updating submodules only." + ); + return void 0; + } + const remoteChangedFiles = (await this.git.diffSummary( + [currentBranch2, trackingBranch, "--"], + (err) => this.onError(err) + )).changed; await this.git.env({ ...process.env, OBSIDIAN_GIT: 1 }).push((err) => this.onError(err)); return remoteChangedFiles; } @@ -29948,7 +30295,7 @@ var SimpleGit = class extends GitManager { } async getRemoteUrl(remote) { try { - await this.git.remote(["get-url", remote]); + return await this.git.remote(["get-url", remote]) || void 0; } catch (error) { if (error.toString().contains(remote)) { return void 0; @@ -29961,7 +30308,7 @@ var SimpleGit = class extends GitManager { async log(file, relativeToVault = true, limit) { let path2; if (file) { - path2 = this.asRepositoryRelativePath(file, relativeToVault); + path2 = this.getRelativeRepoPath(file, relativeToVault); } const res = await this.git.log( { @@ -29976,7 +30323,11 @@ var SimpleGit = class extends GitManager { var _a2, _b, _c, _d; return { ...e, - refs: e.refs.split(", "), + author: { + name: e.author_name, + email: e.author_email + }, + refs: e.refs.split(", ").filter((e2) => e2.length > 0), diff: { ...e.diff, files: (_b = (_a2 = e.diff) == null ? void 0 : _a2.files.map((f) => ({ @@ -29984,7 +30335,7 @@ var SimpleGit = class extends GitManager { status: f.status, path: f.file, hash: e.hash, - vault_path: this.getVaultPath(f.file) + vault_path: this.getRelativeVaultPath(f.file) }))) != null ? _b : [] }, fileName: (_d = (_c = e.diff) == null ? void 0 : _c.files.first()) == null ? void 0 : _d.file @@ -29992,7 +30343,7 @@ var SimpleGit = class extends GitManager { }); } async show(commitHash, file, relativeToVault = true) { - const path2 = this.asRepositoryRelativePath(file, relativeToVault); + const path2 = this.getRelativeRepoPath(file, relativeToVault); return this.git.show( [commitHash + ":" + path2], (err) => this.onError(err) @@ -30081,8 +30432,6 @@ var SimpleGit = class extends GitManager { ["-r", "--list", `${remote}*`], (err) => this.onError(err) ); - console.log(remote); - console.log(res); const list = []; for (const item in res.branches) { list.push(res.branches[item].name); @@ -30393,12 +30742,13 @@ var import_obsidian8 = require("obsidian"); // src/gitManager/isomorphicGit.ts init_polyfill_buffer(); -// node_modules/.pnpm/diff@5.1.0/node_modules/diff/lib/index.mjs +// node_modules/.pnpm/diff@5.2.0/node_modules/diff/lib/index.mjs init_polyfill_buffer(); function Diff() { } Diff.prototype = { diff: function diff(oldString, newString) { + var _options$timeout; var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; var callback = options.callback; if (typeof options === "function") { @@ -30427,42 +30777,53 @@ Diff.prototype = { if (options.maxEditLength) { maxEditLength = Math.min(maxEditLength, options.maxEditLength); } + var maxExecutionTime = (_options$timeout = options.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity; + var abortAfterTimestamp = Date.now() + maxExecutionTime; var bestPath = [{ - newPos: -1, - components: [] + oldPos: -1, + lastComponent: void 0 }]; - var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); - if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { + var newPos = this.extractCommon(bestPath[0], newString, oldString, 0); + if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) { return done([{ value: this.join(newString), count: newString.length }]); } + var minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity; function execEditLength() { - for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { + for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) { var basePath = void 0; - var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; - if (addPath) { + var removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1]; + if (removePath) { bestPath[diagonalPath - 1] = void 0; } - var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; + var canAdd = false; + if (addPath) { + var addPathNewPos = addPath.oldPos - diagonalPath; + canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen; + } + var canRemove = removePath && removePath.oldPos + 1 < 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); + if (!canRemove || canAdd && removePath.oldPos + 1 < addPath.oldPos) { + basePath = self2.addToPath(addPath, true, void 0, 0); } else { - basePath = addPath; - basePath.newPos++; - self2.pushComponent(basePath.components, true, void 0); + basePath = self2.addToPath(removePath, void 0, true, 1); } - _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)); + newPos = self2.extractCommon(basePath, newString, oldString, diagonalPath); + if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) { + return done(buildValues(self2, basePath.lastComponent, newString, oldString, self2.useLongestToken)); } else { bestPath[diagonalPath] = basePath; + if (basePath.oldPos + 1 >= oldLen) { + maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1); + } + if (newPos + 1 >= newLen) { + minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1); + } } } editLength++; @@ -30470,7 +30831,7 @@ Diff.prototype = { if (callback) { (function exec() { setTimeout(function() { - if (editLength > maxEditLength) { + if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) { return callback(); } if (!execEditLength()) { @@ -30479,7 +30840,7 @@ Diff.prototype = { }, 0); })(); } else { - while (editLength <= maxEditLength) { + while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) { var ret = execEditLength(); if (ret) { return ret; @@ -30487,36 +30848,45 @@ Diff.prototype = { } } }, - pushComponent: function pushComponent(components, added, removed) { - var last2 = components[components.length - 1]; + addToPath: function addToPath(path2, added, removed, oldPosInc) { + var last2 = path2.lastComponent; if (last2 && last2.added === added && last2.removed === removed) { - components[components.length - 1] = { - count: last2.count + 1, - added, - removed + return { + oldPos: path2.oldPos + oldPosInc, + lastComponent: { + count: last2.count + 1, + added, + removed, + previousComponent: last2.previousComponent + } }; } else { - components.push({ - count: 1, - added, - removed - }); + return { + oldPos: path2.oldPos + oldPosInc, + lastComponent: { + count: 1, + added, + removed, + previousComponent: last2 + } + }; } }, extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { - var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0; + var newLen = newString.length, oldLen = oldString.length, oldPos = basePath.oldPos, newPos = oldPos - 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.lastComponent = { + count: commonCount, + previousComponent: basePath.lastComponent + }; } - basePath.newPos = newPos; - return oldPos; + basePath.oldPos = oldPos; + return newPos; }, equals: function equals(left, right) { if (this.options.comparator) { @@ -30544,7 +30914,16 @@ Diff.prototype = { return chars.join(""); } }; -function buildValues(diff2, components, newString, oldString, useLongestToken) { +function buildValues(diff3, lastComponent, newString, oldString, useLongestToken) { + var components = []; + var nextComponent; + while (lastComponent) { + components.push(lastComponent); + nextComponent = lastComponent.previousComponent; + delete lastComponent.previousComponent; + lastComponent = nextComponent; + } + components.reverse(); var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0; for (; componentPos < componentLen; componentPos++) { var component = components[componentPos]; @@ -30555,16 +30934,16 @@ function buildValues(diff2, components, newString, oldString, useLongestToken) { var oldValue = oldString[oldPos + i]; return oldValue.length > value2.length ? oldValue : value2; }); - component.value = diff2.join(value); + component.value = diff3.join(value); } else { - component.value = diff2.join(newString.slice(newPos, newPos + component.count)); + component.value = diff3.join(newString.slice(newPos, newPos + component.count)); } newPos += component.count; if (!component.added) { oldPos += component.count; } } else { - component.value = diff2.join(oldString.slice(oldPos, oldPos + component.count)); + component.value = diff3.join(oldString.slice(oldPos, oldPos + component.count)); oldPos += component.count; if (componentPos && components[componentPos - 1].added) { var tmp = components[componentPos - 1]; @@ -30573,23 +30952,14 @@ function buildValues(diff2, components, newString, oldString, useLongestToken) { } } } - var lastComponent = components[componentLen - 1]; - if (componentLen > 1 && typeof lastComponent.value === "string" && (lastComponent.added || lastComponent.removed) && diff2.equals("", lastComponent.value)) { - components[componentLen - 2].value += lastComponent.value; + var finalComponent = components[componentLen - 1]; + if (componentLen > 1 && typeof finalComponent.value === "string" && (finalComponent.added || finalComponent.removed) && diff3.equals("", finalComponent.value)) { + components[componentLen - 2].value += finalComponent.value; components.pop(); } return components; } -function clonePath(path2) { - return { - newPos: path2.newPos, - components: path2.components.slice(0) - }; -} var characterDiff = new Diff(); -function diffChars(oldStr, newStr, options) { - return characterDiff.diff(oldStr, newStr, options); -} var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; var reWhitespace = /\S/; var wordDiff = new Diff(); @@ -30611,11 +30981,11 @@ wordDiff.tokenize = function(value) { } return tokens; }; -function diffWordsWithSpace(oldStr, newStr, options) { - return wordDiff.diff(oldStr, newStr, options); -} var lineDiff = new Diff(); lineDiff.tokenize = function(value) { + if (this.options.stripTrailingCr) { + value = value.replace(/\r\n/g, "\n"); + } var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/); if (!linesAndNewlines[linesAndNewlines.length - 1]) { linesAndNewlines.pop(); @@ -30767,11 +31137,11 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne if (typeof options.context === "undefined") { options.context = 4; } - var diff2 = diffLines(oldStr, newStr, options); - if (!diff2) { + var diff3 = diffLines(oldStr, newStr, options); + if (!diff3) { return; } - diff2.push({ + diff3.push({ value: "", lines: [] }); @@ -30783,12 +31153,12 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne var hunks = []; var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1; var _loop = function _loop2(i2) { - var current = diff2[i2], lines = current.lines || current.value.replace(/\n$/, "").split("\n"); + var current = diff3[i2], lines = current.lines || current.value.replace(/\n$/, "").split("\n"); current.lines = lines; if (current.added || current.removed) { var _curRange; if (!oldRangeStart) { - var prev = diff2[i2 - 1]; + var prev = diff3[i2 - 1]; oldRangeStart = oldLine; newRangeStart = newLine; if (prev) { @@ -30807,7 +31177,7 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne } } else { if (oldRangeStart) { - if (lines.length <= options.context * 2 && i2 < diff2.length - 2) { + if (lines.length <= options.context * 2 && i2 < diff3.length - 2) { var _curRange2; (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines))); } else { @@ -30821,7 +31191,7 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne newLines: newLine - newRangeStart + contextSize, lines: curRange }; - if (i2 >= diff2.length - 2 && lines.length <= options.context) { + if (i2 >= diff3.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; @@ -30842,7 +31212,7 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne newLine += lines.length; } }; - for (var i = 0; i < diff2.length; i++) { + for (var i = 0; i < diff3.length; i++) { _loop(i); } return { @@ -30853,16 +31223,19 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne hunks }; } -function formatPatch(diff2) { +function formatPatch(diff3) { + if (Array.isArray(diff3)) { + return diff3.map(formatPatch).join("\n"); + } var ret = []; - if (diff2.oldFileName == diff2.newFileName) { - ret.push("Index: " + diff2.oldFileName); + if (diff3.oldFileName == diff3.newFileName) { + ret.push("Index: " + diff3.oldFileName); } ret.push("==================================================================="); - ret.push("--- " + diff2.oldFileName + (typeof diff2.oldHeader === "undefined" ? "" : " " + diff2.oldHeader)); - ret.push("+++ " + diff2.newFileName + (typeof diff2.newHeader === "undefined" ? "" : " " + diff2.newHeader)); - for (var i = 0; i < diff2.hunks.length; i++) { - var hunk = diff2.hunks[i]; + ret.push("--- " + diff3.oldFileName + (typeof diff3.oldHeader === "undefined" ? "" : " " + diff3.oldHeader)); + ret.push("+++ " + diff3.newFileName + (typeof diff3.newHeader === "undefined" ? "" : " " + diff3.newHeader)); + for (var i = 0; i < diff3.hunks.length; i++) { + var hunk = diff3.hunks[i]; if (hunk.oldLines === 0) { hunk.oldStart -= 1; } @@ -31115,7 +31488,9 @@ var MyAdapter = class { async saveAndClear() { if (this.index !== void 0) { await this.adapter.writeBinary( - this.plugin.gitManager.getVaultPath(this.gitDir + "/index"), + this.plugin.gitManager.getRelativeVaultPath( + this.gitDir + "/index" + ), this.index, { ctime: this.indexctime, @@ -31263,7 +31638,7 @@ var IsomorphicGit = class extends GitManager { const conflicted = []; window.clearTimeout(timeout); notice == null ? void 0 : notice.hide(); - return { changed, staged, conflicted }; + return { all: status2, changed, staged, conflicted }; } catch (error) { window.clearTimeout(timeout); notice == null ? void 0 : notice.hide(); @@ -31279,13 +31654,15 @@ var IsomorphicGit = class extends GitManager { try { await this.checkAuthorInfo(); await this.stageAll({ status: status2, unstagedFiles }); - return this.commit(message); + return this.commit({ message }); } catch (error) { this.plugin.displayError(error); throw error; } } - async commit(message) { + async commit({ + message + }) { try { await this.checkAuthorInfo(); this.plugin.setState(4 /* commit */); @@ -31311,15 +31688,12 @@ var IsomorphicGit = class extends GitManager { } } async stage(filepath, relativeToVault) { - const gitPath = this.asRepositoryRelativePath( - filepath, - relativeToVault - ); + const gitPath = this.getRelativeRepoPath(filepath, relativeToVault); let vaultPath; if (relativeToVault) { vaultPath = filepath; } else { - vaultPath = this.getVaultPath(filepath); + vaultPath = this.getRelativeVaultPath(filepath); } try { this.plugin.setState(3 /* add */); @@ -31375,7 +31749,7 @@ var IsomorphicGit = class extends GitManager { async unstage(filepath, relativeToVault) { try { this.plugin.setState(3 /* add */); - filepath = this.asRepositoryRelativePath(filepath, relativeToVault); + filepath = this.getRelativeRepoPath(filepath, relativeToVault); await this.wrapFS( isomorphic_git_default.resetIndex({ ...this.getRepo(), filepath }) ); @@ -31509,13 +31883,15 @@ var IsomorphicGit = class extends GitManager { path: file.path, working_dir: "P", index: "P", - vault_path: this.getVaultPath(file.path) + vault_path: this.getRelativeVaultPath(file.path) })); } catch (error) { progressNotice == null ? void 0 : progressNotice.hide(); if (error instanceof Errors.MergeConflictError) { this.plugin.handleConflict( - error.data.filepaths.map((file) => this.getVaultPath(file)) + error.data.filepaths.map( + (file) => this.getRelativeVaultPath(file) + ) ); } this.plugin.displayError(error); @@ -31641,7 +32017,7 @@ var IsomorphicGit = class extends GitManager { throw error; } } - async branchIsMerged(branch2) { + async branchIsMerged(_) { return true; } async init() { @@ -31771,6 +32147,10 @@ var IsomorphicGit = class extends GitManager { const completeMessage = log2.commit.message.split("\n\n"); return { message: completeMessage[0], + author: { + name: log2.commit.author.name, + email: log2.commit.author.email + }, body: completeMessage.slice(1).join("\n\n"), date: new Date( log2.commit.committer.timestamp @@ -31784,7 +32164,9 @@ var IsomorphicGit = class extends GitManager { return { path: item.path, status: item.type, - vault_path: this.getVaultPath(item.path), + vault_path: this.getRelativeVaultPath( + item.path + ), hash: log2.oid, binary: void 0 }; @@ -31808,7 +32190,7 @@ var IsomorphicGit = class extends GitManager { ); await this.setConfig(`branch.${branch2}.remote`, remote); } - updateGitPath(gitPath) { + updateGitPath(_) { return; } async getFileChangesCount(commitHash1, commitHash2) { @@ -31870,7 +32252,7 @@ var IsomorphicGit = class extends GitManager { }); return res.map((file) => { return { - vault_path: this.getVaultPath(file.path), + vault_path: this.getRelativeVaultPath(file.path), filepath: file.path }; }); @@ -31950,7 +32332,7 @@ var IsomorphicGit = class extends GitManager { } } async getDiffString(filePath, stagedChanges = false, hash2) { - const vaultPath = this.getVaultPath(filePath); + const vaultPath = this.getRelativeVaultPath(filePath); const map = async (file, [A]) => { if (filePath == file) { const oid = await A.oid(); @@ -31984,12 +32366,12 @@ var IsomorphicGit = class extends GitManager { return void 0; throw err; }); - const diff2 = createPatch( + const diff3 = createPatch( vaultPath, previousContent != null ? previousContent : "", commitContent != null ? commitContent : "" ); - return diff2; + return diff3; } const stagedBlob = (await isomorphic_git_default.walk({ ...this.getRepo(), @@ -32009,21 +32391,21 @@ var IsomorphicGit = class extends GitManager { return void 0; throw err; }); - const diff2 = createPatch( + const diff3 = createPatch( vaultPath, headContent != null ? headContent : "", stagedContent ); - return diff2; + return diff3; } else { let workdirContent; - if (await app.vault.adapter.exists(vaultPath)) { - workdirContent = await app.vault.adapter.read(vaultPath); + if (await this.app.vault.adapter.exists(vaultPath)) { + workdirContent = await this.app.vault.adapter.read(vaultPath); } else { workdirContent = ""; } - const diff2 = createPatch(vaultPath, stagedContent, workdirContent); - return diff2; + const diff3 = createPatch(vaultPath, stagedContent, workdirContent); + return diff3; } } async getLastCommitTime() { @@ -32039,7 +32421,7 @@ var IsomorphicGit = class extends GitManager { index: status2[0] == "?" ? "U" : status2[0], working_dir: status2[1] == "?" ? "U" : status2[1], path: row[this.FILE], - vault_path: this.getVaultPath(row[this.FILE]) + vault_path: this.getRelativeVaultPath(row[this.FILE]) }; } async checkAuthorInfo() { @@ -32305,14 +32687,14 @@ var ObsidianGitSettingsTab = class extends import_obsidian8.PluginSettingTab { plugin.saveSettings(); }) ); - new import_obsidian8.Setting(containerEl).setName("{{date}} placeholder format").setDesc( - `Specify custom date format. E.g. "${DATE_TIME_FORMAT_SECONDS}"` - ).addText( + const datePlaceholderSetting = new import_obsidian8.Setting(containerEl).setName("{{date}} placeholder format").addText( (text2) => text2.setPlaceholder(plugin.settings.commitDateFormat).setValue(plugin.settings.commitDateFormat).onChange(async (value) => { plugin.settings.commitDateFormat = value; await plugin.saveSettings(); }) ); + datePlaceholderSetting.descEl.innerHTML = ` + Specify custom date format. E.g. "${DATE_TIME_FORMAT_SECONDS}. See Moment.js for more formats.`; new import_obsidian8.Setting(containerEl).setName("{{hostname}} placeholder replacement").setDesc("Specify custom hostname for every device.").addText( (text2) => { var _a2; @@ -32378,7 +32760,32 @@ var ObsidianGitSettingsTab = class extends import_obsidian8.PluginSettingTab { } } containerEl.createEl("br"); - containerEl.createEl("h3", { text: "Miscellaneous" }); + containerEl.createEl("h3", { text: "History View" }); + new import_obsidian8.Setting(containerEl).setName("Show Author").setDesc("Show the author of the commit in the history view").addDropdown((dropdown) => { + const options = { + hide: "Hide", + full: "Full", + initials: "Initials" + }; + dropdown.addOptions(options); + dropdown.setValue(plugin.settings.authorInHistoryView); + dropdown.onChange(async (option) => { + plugin.settings.authorInHistoryView = option; + plugin.saveSettings(); + plugin.refresh(); + }); + }); + new import_obsidian8.Setting(containerEl).setName("Show Date").setDesc( + "Show the date of the commit in the history view. The {{date}} placeholder format is used to display the date." + ).addToggle( + (toggle) => toggle.setValue(plugin.settings.dateInHistoryView).onChange((value) => { + plugin.settings.dateInHistoryView = value; + plugin.saveSettings(); + plugin.refresh(); + }) + ); + containerEl.createEl("br"); + containerEl.createEl("h3", { text: "Source Control View" }); new import_obsidian8.Setting(containerEl).setName( "Automatically refresh Source Control View on file changes" ).setDesc( @@ -32403,14 +32810,26 @@ var ObsidianGitSettingsTab = class extends import_obsidian8.PluginSettingTab { plugin.setRefreshDebouncer(); }) ); + containerEl.createEl("br"); + containerEl.createEl("h3", { text: "Miscellaneous" }); new import_obsidian8.Setting(containerEl).setName("Disable notifications").setDesc( "Disable notifications for git operations to minimize distraction (refer to status bar for updates). Errors are still shown as notifications even if you enable this setting" ).addToggle( (toggle) => toggle.setValue(plugin.settings.disablePopups).onChange((value) => { plugin.settings.disablePopups = value; + this.display(); plugin.saveSettings(); }) ); + if (!plugin.settings.disablePopups) + new import_obsidian8.Setting(containerEl).setName("Hide notifications for no changes").setDesc( + "Don't show notifications when there are no changes to commit/push" + ).addToggle( + (toggle) => toggle.setValue(plugin.settings.disablePopupsForNoChanges).onChange((value) => { + plugin.settings.disablePopupsForNoChanges = value; + plugin.saveSettings(); + }) + ); new import_obsidian8.Setting(containerEl).setName("Show status bar").setDesc( "Obsidian must be restarted for the changes to take affect" ).addToggle( @@ -32573,7 +32992,9 @@ var ObsidianGitSettingsTab = class extends import_obsidian8.PluginSettingTab { plugin.saveSettings(); }); }); - new import_obsidian8.Setting(containerEl).setName("Disable on this device").addToggle( + new import_obsidian8.Setting(containerEl).setName("Disable on this device").setDesc( + "Disables the plugin on this device. This setting is not synced." + ).addToggle( (toggle) => toggle.setValue(plugin.localStorage.getPluginDisabled()).onChange((value) => { plugin.localStorage.setPluginDisabled(value); if (value) { @@ -32997,7 +33418,7 @@ var LineAuthoringSubscriber = class { async notifyLineAuthoring(id, la) { if (this.view === void 0) { console.warn( - `Obsidian Git: View is not defined for editor cache key. Unforeseen situation. id: ${id}` + `Git: View is not defined for editor cache key. Unforeseen situation. id: ${id}` ); return; } @@ -33440,9 +33861,9 @@ var LineAuthoringGutter = class extends import_view.GutterMarker { break; case "natural language": dateTimeFormatting = (time) => { - const diff2 = time.diff((0, import_obsidian10.moment)()); + const diff3 = time.diff((0, import_obsidian10.moment)()); const addFluentSuffix = true; - return import_obsidian10.moment.duration(diff2).humanize(addFluentSuffix); + return import_obsidian10.moment.duration(diff3).humanize(addFluentSuffix); }; break; default: @@ -33747,7 +34168,7 @@ var LineAuthorProvider = class { } async trackChanged(file) { this.trackChangedHelper(file).catch((reason) => { - console.warn("Obsidian Git: Error in trackChanged." + reason); + console.warn("Git: Error in trackChanged." + reason); return Promise.reject(reason); }); } @@ -33756,7 +34177,7 @@ var LineAuthorProvider = class { return; if (file.path === void 0) { console.warn( - "Obsidian Git: Attempted to track change of undefined filepath. Unforeseen situation." + "Git: Attempted to track change of undefined filepath. Unforeseen situation." ); return; } @@ -33813,7 +34234,7 @@ var LineAuthoringFeature = class { const file = obsView == null ? void 0 : obsView.file; if (!this.lineAuthorInfoProvider) { console.warn( - "Obsidian Git: undefined lineAuthorInfoProvider. Unexpected situation." + "Git: undefined lineAuthorInfoProvider. Unexpected situation." ); return; } @@ -33848,10 +34269,7 @@ var LineAuthoringFeature = class { this.activateCodeMirrorExtensions(); console.log(this.plg.manifest.name + ": Enabled line authoring."); } catch (e) { - console.warn( - "Obsidian Git: Error while loading line authoring feature.", - e - ); + console.warn("Git: Error while loading line authoring feature.", e); this.deactivateFeature(); } } @@ -33991,7 +34409,6 @@ var StatusBar = class { this.plugin = plugin; this.messages = []; this.base = "obsidian-git-statusbar-"; - this.statusBarEl.setAttribute("aria-label-position", "top"); this.statusBarEl.setAttribute("data-tooltip-position", "top"); addEventListener("git-refresh", this.refreshCommitTimestamp.bind(this)); } @@ -34073,8 +34490,8 @@ var StatusBar = class { var _a2; const timestamp = this.lastCommitTimestamp; if (timestamp) { - const moment5 = window.moment; - const fromNow = moment5(timestamp).fromNow(); + const moment6 = window.moment; + const fromNow = moment6(timestamp).fromNow(); this.statusBarEl.ariaLabel = `${this.plugin.offlineMode ? "Offline: " : ""}Last Commit: ${fromNow}`; if ((_a2 = this.unPushedCommits) != null ? _a2 : 0 > 0) { this.statusBarEl.ariaLabel += ` @@ -34123,7 +34540,7 @@ var ChangedFilesModal = class extends import_obsidian14.FuzzySuggestModal { let working_dir = ""; let index2 = ""; if (item.working_dir != " ") - working_dir = `Working dir: ${item.working_dir} `; + working_dir = `Working Dir: ${item.working_dir} `; if (item.index != " ") index2 = `Index: ${item.index}`; return `${working_dir}${index2} | ${item.vault_path}`; @@ -34192,7 +34609,7 @@ async function openLineInGitHub(editor, file, manager) { } const { isGitHub, branch: branch2, repo, user } = data; if (isGitHub) { - const path2 = manager.asRepositoryRelativePath(file.path, true); + const path2 = manager.getRelativeRepoPath(file.path); const from = editor.getCursor("from").line + 1; const to = editor.getCursor("to").line + 1; if (from === to) { @@ -34215,7 +34632,7 @@ async function openHistoryInGitHub(file, manager) { return; } const { isGitHub, branch: branch2, repo, user } = data; - const path2 = manager.asRepositoryRelativePath(file.path, true); + const path2 = manager.getRelativeRepoPath(file.path); if (isGitHub) { window.open( `https://github.com/${user}/${repo}/commits/${branch2}/${path2}` @@ -34362,13 +34779,13 @@ var LocalStorageSettings = class { // src/ui/diff/diffView.ts init_polyfill_buffer(); -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/diff2html.js +// node_modules/.pnpm/diff2html@3.4.47/node_modules/diff2html/lib-esm/diff2html.js init_polyfill_buffer(); -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/diff-parser.js +// node_modules/.pnpm/diff2html@3.4.47/node_modules/diff2html/lib-esm/diff-parser.js init_polyfill_buffer(); -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/types.js +// node_modules/.pnpm/diff2html@3.4.47/node_modules/diff2html/lib-esm/types.js init_polyfill_buffer(); var LineType; (function(LineType2) { @@ -34389,8 +34806,14 @@ var DiffStyleType = { WORD: "word", CHAR: "char" }; +var ColorSchemeType; +(function(ColorSchemeType2) { + ColorSchemeType2["AUTO"] = "auto"; + ColorSchemeType2["DARK"] = "dark"; + ColorSchemeType2["LIGHT"] = "light"; +})(ColorSchemeType || (ColorSchemeType = {})); -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/utils.js +// node_modules/.pnpm/diff2html@3.4.47/node_modules/diff2html/lib-esm/utils.js init_polyfill_buffer(); var specials = [ "-", @@ -34428,7 +34851,7 @@ function hashCode(text2) { return hash2; } -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/diff-parser.js +// node_modules/.pnpm/diff2html@3.4.47/node_modules/diff2html/lib-esm/diff-parser.js function getExtension(filename, language) { const filenameParts = filename.split("."); return filenameParts.length > 1 ? filenameParts[filenameParts.length - 1] : language; @@ -34719,13 +35142,344 @@ function parse(diffInput, config = {}) { return files; } -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/file-list-renderer.js +// node_modules/.pnpm/diff2html@3.4.47/node_modules/diff2html/lib-esm/file-list-renderer.js init_polyfill_buffer(); -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/render-utils.js +// node_modules/.pnpm/diff2html@3.4.47/node_modules/diff2html/lib-esm/render-utils.js init_polyfill_buffer(); -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/rematch.js +// node_modules/.pnpm/diff@5.1.0/node_modules/diff/lib/index.mjs +init_polyfill_buffer(); +function Diff2() { +} +Diff2.prototype = { + diff: function diff2(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; + if (options.maxEditLength) { + maxEditLength = Math.min(maxEditLength, options.maxEditLength); + } + 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(buildValues2(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 last2 = components[components.length - 1]; + if (last2 && last2.added === added && last2.removed === removed) { + components[components.length - 1] = { + count: last2.count + 1, + added, + removed + }; + } else { + components.push({ + count: 1, + added, + removed + }); + } + }, + extractCommon: function extractCommon2(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 equals2(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 removeEmpty2(array) { + var ret = []; + for (var i = 0; i < array.length; i++) { + if (array[i]) { + ret.push(array[i]); + } + } + return ret; + }, + castInput: function castInput2(value) { + return value; + }, + tokenize: function tokenize2(value) { + return value.split(""); + }, + join: function join4(chars) { + return chars.join(""); + } +}; +function buildValues2(diff3, 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 = diff3.join(value); + } else { + component.value = diff3.join(newString.slice(newPos, newPos + component.count)); + } + newPos += component.count; + if (!component.added) { + oldPos += component.count; + } + } else { + component.value = diff3.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) && diff3.equals("", lastComponent.value)) { + components[componentLen - 2].value += lastComponent.value; + components.pop(); + } + return components; +} +function clonePath(path2) { + return { + newPos: path2.newPos, + components: path2.components.slice(0) + }; +} +var characterDiff2 = new Diff2(); +function diffChars(oldStr, newStr, options) { + return characterDiff2.diff(oldStr, newStr, options); +} +var extendedWordChars2 = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; +var reWhitespace2 = /\S/; +var wordDiff2 = new Diff2(); +wordDiff2.equals = function(left, right) { + if (this.options.ignoreCase) { + left = left.toLowerCase(); + right = right.toLowerCase(); + } + return left === right || this.options.ignoreWhitespace && !reWhitespace2.test(left) && !reWhitespace2.test(right); +}; +wordDiff2.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] && extendedWordChars2.test(tokens[i]) && extendedWordChars2.test(tokens[i + 2])) { + tokens[i] += tokens[i + 2]; + tokens.splice(i + 1, 2); + i--; + } + } + return tokens; +}; +function diffWordsWithSpace(oldStr, newStr, options) { + return wordDiff2.diff(oldStr, newStr, options); +} +var lineDiff2 = new Diff2(); +lineDiff2.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; +}; +var sentenceDiff2 = new Diff2(); +sentenceDiff2.tokenize = function(value) { + return value.split(/(\S.+?[.!?])(?=\s+|$)/); +}; +var cssDiff2 = new Diff2(); +cssDiff2.tokenize = function(value) { + return value.split(/([{}:;,]|\s+)/); +}; +function _typeof2(obj) { + "@babel/helpers - typeof"; + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof2 = function(obj2) { + return typeof obj2; + }; + } else { + _typeof2 = function(obj2) { + return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }; + } + return _typeof2(obj); +} +var objectPrototypeToString2 = Object.prototype.toString; +var jsonDiff2 = new Diff2(); +jsonDiff2.useLongestToken = true; +jsonDiff2.tokenize = lineDiff2.tokenize; +jsonDiff2.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(canonicalize2(value, null, null, stringifyReplacer), stringifyReplacer, " "); +}; +jsonDiff2.equals = function(left, right) { + return Diff2.prototype.equals.call(jsonDiff2, left.replace(/,([\r\n])/g, "$1"), right.replace(/,([\r\n])/g, "$1")); +}; +function canonicalize2(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 ("[object Array]" === objectPrototypeToString2.call(obj)) { + stack.push(obj); + canonicalizedObj = new Array(obj.length); + replacementStack.push(canonicalizedObj); + for (i = 0; i < obj.length; i += 1) { + canonicalizedObj[i] = canonicalize2(obj[i], stack, replacementStack, replacer, key2); + } + stack.pop(); + replacementStack.pop(); + return canonicalizedObj; + } + if (obj && obj.toJSON) { + obj = obj.toJSON(); + } + if (_typeof2(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] = canonicalize2(obj[_key], stack, replacementStack, replacer, _key); + } + stack.pop(); + replacementStack.pop(); + } else { + canonicalizedObj = obj; + } + return canonicalizedObj; +} +var arrayDiff2 = new Diff2(); +arrayDiff2.tokenize = function(value) { + return value.slice(); +}; +arrayDiff2.join = arrayDiff2.removeEmpty = function(value) { + return value; +}; + +// node_modules/.pnpm/diff2html@3.4.47/node_modules/diff2html/lib-esm/rematch.js init_polyfill_buffer(); function levenshtein(a, b) { if (a.length === 0) { @@ -34810,7 +35564,7 @@ function newMatcherFn(distance2) { return group; } -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/render-utils.js +// node_modules/.pnpm/diff2html@3.4.47/node_modules/diff2html/lib-esm/render-utils.js var CSSLineClass = { INSERTS: "d2h-ins", DELETES: "d2h-del", @@ -34823,7 +35577,8 @@ var defaultRenderConfig = { matching: LineMatchingType.NONE, matchWordsThreshold: 0.25, maxLineLengthHighlight: 1e4, - diffStyle: DiffStyleType.WORD + diffStyle: DiffStyleType.WORD, + colorScheme: ColorSchemeType.LIGHT }; var separator = "/"; var distance = newDistanceFn((change) => change.value); @@ -34847,6 +35602,17 @@ function toCSSClass(lineType) { return CSSLineClass.DELETES; } } +function colorSchemeToCss(colorScheme) { + switch (colorScheme) { + case ColorSchemeType.DARK: + return "d2h-dark-color-scheme"; + case ColorSchemeType.AUTO: + return "d2h-auto-color-scheme"; + case ColorSchemeType.LIGHT: + default: + return "d2h-light-color-scheme"; + } +} function prefixLength(isCombined) { return isCombined ? 2 : 1; } @@ -34942,11 +35708,11 @@ function diffHighlight(diffLine1, diffLine2, isCombined, config = {}) { } }; } - const diff2 = diffStyle === "char" ? diffChars(line1.content, line2.content) : diffWordsWithSpace(line1.content, line2.content); + const diff3 = diffStyle === "char" ? diffChars(line1.content, line2.content) : diffWordsWithSpace(line1.content, line2.content); const changedWords = []; if (diffStyle === "word" && matching === "words") { - const removed = diff2.filter((element2) => element2.removed); - const added = diff2.filter((element2) => element2.added); + const removed = diff3.filter((element2) => element2.removed); + const added = diff3.filter((element2) => element2.added); const chunks = matcher(added, removed); chunks.forEach((chunk) => { if (chunk[0].length === 1 && chunk[1].length === 1) { @@ -34958,7 +35724,7 @@ function diffHighlight(diffLine1, diffLine2, isCombined, config = {}) { } }); } - const highlightedLine = diff2.reduce((highlightedLine2, part) => { + const highlightedLine = diff3.reduce((highlightedLine2, part) => { const elemType = part.added ? "ins" : part.removed ? "del" : null; const addClass = changedWords.indexOf(part) > -1 ? ' class="d2h-change"' : ""; const escapedValue = escapeForHtml(part.value); @@ -34976,27 +35742,37 @@ function diffHighlight(diffLine1, diffLine2, isCombined, config = {}) { }; } -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/file-list-renderer.js +// node_modules/.pnpm/diff2html@3.4.47/node_modules/diff2html/lib-esm/file-list-renderer.js var baseTemplatesPath = "file-summary"; var iconsBaseTemplatesPath = "icon"; -function render(diffFiles, hoganUtils) { - const files = diffFiles.map((file) => hoganUtils.render(baseTemplatesPath, "line", { - fileHtmlId: getHtmlId(file), - oldName: file.oldName, - newName: file.newName, - fileName: filenameDiff(file), - deletedLines: "-" + file.deletedLines, - addedLines: "+" + file.addedLines - }, { - fileIcon: hoganUtils.template(iconsBaseTemplatesPath, getFileIcon(file)) - })).join("\n"); - return hoganUtils.render(baseTemplatesPath, "wrapper", { - filesNumber: diffFiles.length, - files - }); -} +var defaultFileListRendererConfig = { + colorScheme: defaultRenderConfig.colorScheme +}; +var FileListRenderer = class { + constructor(hoganUtils, config = {}) { + this.hoganUtils = hoganUtils; + this.config = Object.assign(Object.assign({}, defaultFileListRendererConfig), config); + } + render(diffFiles) { + const files = diffFiles.map((file) => this.hoganUtils.render(baseTemplatesPath, "line", { + fileHtmlId: getHtmlId(file), + oldName: file.oldName, + newName: file.newName, + fileName: filenameDiff(file), + deletedLines: "-" + file.deletedLines, + addedLines: "+" + file.addedLines + }, { + fileIcon: this.hoganUtils.template(iconsBaseTemplatesPath, getFileIcon(file)) + })).join("\n"); + return this.hoganUtils.render(baseTemplatesPath, "wrapper", { + colorScheme: colorSchemeToCss(this.config.colorScheme), + filesNumber: diffFiles.length, + files + }); + } +}; -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/line-by-line-renderer.js +// node_modules/.pnpm/diff2html@3.4.47/node_modules/diff2html/lib-esm/line-by-line-renderer.js init_polyfill_buffer(); var defaultLineByLineRendererConfig = Object.assign(Object.assign({}, defaultRenderConfig), { renderNothingWhenEmpty: false, matchingMaxComparisons: 2500, maxLineSizeInBlockForComparison: 200 }); var genericTemplatesPath = "generic"; @@ -35018,7 +35794,10 @@ var LineByLineRenderer = class { } return this.makeFileDiffHtml(file, diffs); }).join("\n"); - return this.hoganUtils.render(genericTemplatesPath, "wrapper", { content: diffsHtml }); + return this.hoganUtils.render(genericTemplatesPath, "wrapper", { + colorScheme: colorSchemeToCss(this.config.colorScheme), + content: diffsHtml + }); } makeFileDiffHtml(file, diffs) { if (this.config.renderNothingWhenEmpty && Array.isArray(file.blocks) && file.blocks.length === 0) @@ -35126,15 +35905,15 @@ var LineByLineRenderer = class { for (let i = 0; i < maxLinesNumber; i++) { const oldLine = oldLines[i]; const newLine = newLines[i]; - const diff2 = oldLine !== void 0 && newLine !== void 0 ? diffHighlight(oldLine.content, newLine.content, isCombined, this.config) : void 0; - const preparedOldLine = oldLine !== void 0 && oldLine.oldNumber !== void 0 ? Object.assign(Object.assign({}, diff2 !== void 0 ? { - prefix: diff2.oldLine.prefix, - content: diff2.oldLine.content, + const diff3 = oldLine !== void 0 && newLine !== void 0 ? diffHighlight(oldLine.content, newLine.content, isCombined, this.config) : void 0; + const preparedOldLine = oldLine !== void 0 && oldLine.oldNumber !== void 0 ? Object.assign(Object.assign({}, diff3 !== void 0 ? { + prefix: diff3.oldLine.prefix, + content: diff3.oldLine.content, type: CSSLineClass.DELETE_CHANGES } : Object.assign(Object.assign({}, deconstructLine(oldLine.content, isCombined)), { type: toCSSClass(oldLine.type) })), { oldNumber: oldLine.oldNumber, newNumber: oldLine.newNumber }) : void 0; - const preparedNewLine = newLine !== void 0 && newLine.newNumber !== void 0 ? Object.assign(Object.assign({}, diff2 !== void 0 ? { - prefix: diff2.newLine.prefix, - content: diff2.newLine.content, + const preparedNewLine = newLine !== void 0 && newLine.newNumber !== void 0 ? Object.assign(Object.assign({}, diff3 !== void 0 ? { + prefix: diff3.newLine.prefix, + content: diff3.newLine.content, type: CSSLineClass.INSERT_CHANGES } : Object.assign(Object.assign({}, deconstructLine(newLine.content, isCombined)), { type: toCSSClass(newLine.type) })), { oldNumber: newLine.oldNumber, newNumber: newLine.newNumber }) : void 0; const { left, right } = this.generateLineHtml(file, preparedOldLine, preparedNewLine); @@ -35169,7 +35948,7 @@ var LineByLineRenderer = class { } }; -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/side-by-side-renderer.js +// node_modules/.pnpm/diff2html@3.4.47/node_modules/diff2html/lib-esm/side-by-side-renderer.js init_polyfill_buffer(); var defaultSideBySideRendererConfig = Object.assign(Object.assign({}, defaultRenderConfig), { renderNothingWhenEmpty: false, matchingMaxComparisons: 2500, maxLineSizeInBlockForComparison: 200 }); var genericTemplatesPath2 = "generic"; @@ -35191,7 +35970,10 @@ var SideBySideRenderer = class { } return this.makeFileDiffHtml(file, diffs); }).join("\n"); - return this.hoganUtils.render(genericTemplatesPath2, "wrapper", { content: diffsHtml }); + return this.hoganUtils.render(genericTemplatesPath2, "wrapper", { + colorScheme: colorSchemeToCss(this.config.colorScheme), + content: diffsHtml + }); } makeFileDiffHtml(file, diffs) { if (this.config.renderNothingWhenEmpty && Array.isArray(file.blocks) && file.blocks.length === 0) @@ -35316,15 +36098,15 @@ var SideBySideRenderer = class { for (let i = 0; i < maxLinesNumber; i++) { const oldLine = oldLines[i]; const newLine = newLines[i]; - const diff2 = oldLine !== void 0 && newLine !== void 0 ? diffHighlight(oldLine.content, newLine.content, isCombined, this.config) : void 0; - const preparedOldLine = oldLine !== void 0 && oldLine.oldNumber !== void 0 ? Object.assign(Object.assign({}, diff2 !== void 0 ? { - prefix: diff2.oldLine.prefix, - content: diff2.oldLine.content, + const diff3 = oldLine !== void 0 && newLine !== void 0 ? diffHighlight(oldLine.content, newLine.content, isCombined, this.config) : void 0; + const preparedOldLine = oldLine !== void 0 && oldLine.oldNumber !== void 0 ? Object.assign(Object.assign({}, diff3 !== void 0 ? { + prefix: diff3.oldLine.prefix, + content: diff3.oldLine.content, type: CSSLineClass.DELETE_CHANGES } : Object.assign(Object.assign({}, deconstructLine(oldLine.content, isCombined)), { type: toCSSClass(oldLine.type) })), { number: oldLine.oldNumber }) : void 0; - const preparedNewLine = newLine !== void 0 && newLine.newNumber !== void 0 ? Object.assign(Object.assign({}, diff2 !== void 0 ? { - prefix: diff2.newLine.prefix, - content: diff2.newLine.content, + const preparedNewLine = newLine !== void 0 && newLine.newNumber !== void 0 ? Object.assign(Object.assign({}, diff3 !== void 0 ? { + prefix: diff3.newLine.prefix, + content: diff3.newLine.content, type: CSSLineClass.INSERT_CHANGES } : Object.assign(Object.assign({}, deconstructLine(newLine.content, isCombined)), { type: toCSSClass(newLine.type) })), { number: newLine.newNumber }) : void 0; const { left, right } = this.generateLineHtml(preparedOldLine, preparedNewLine); @@ -35353,11 +36135,11 @@ var SideBySideRenderer = class { } }; -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/hoganjs-utils.js +// node_modules/.pnpm/diff2html@3.4.47/node_modules/diff2html/lib-esm/hoganjs-utils.js init_polyfill_buffer(); var Hogan3 = __toESM(require_hogan()); -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/diff2html-templates.js +// node_modules/.pnpm/diff2html@3.4.47/node_modules/diff2html/lib-esm/diff2html-templates.js init_polyfill_buffer(); var Hogan2 = __toESM(require_hogan()); var defaultTemplates = {}; @@ -35395,7 +36177,9 @@ defaultTemplates["file-summary-line"] = new Hogan2.Template({ code: function(c, defaultTemplates["file-summary-wrapper"] = new Hogan2.Template({ code: function(c, p, i) { var t = this; t.b(i = i || ""); - t.b('
'); + t.b('
'); t.b("\n" + i); t.b('
'); t.b("\n" + i); @@ -35560,7 +36344,9 @@ defaultTemplates["generic-line"] = new Hogan2.Template({ code: function(c, p, i) defaultTemplates["generic-wrapper"] = new Hogan2.Template({ code: function(c, p, i) { var t = this; t.b(i = i || ""); - t.b('
'); + t.b('
'); t.b("\n" + i); t.b(" "); t.b(t.t(t.f("content", c, p, 0))); @@ -35762,7 +36548,7 @@ defaultTemplates["tag-file-renamed"] = new Hogan2.Template({ code: function(c, p return t.fl(); }, partials: {}, subs: {} }); -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/hoganjs-utils.js +// node_modules/.pnpm/diff2html@3.4.47/node_modules/diff2html/lib-esm/hoganjs-utils.js var HoganJsUtils = class { constructor({ compiledTemplates = {}, rawTemplates = {} }) { const compiledRawTemplates = Object.entries(rawTemplates).reduce((previousTemplates, [name, templateString]) => { @@ -35791,13 +36577,15 @@ var HoganJsUtils = class { } }; -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/diff2html.js +// node_modules/.pnpm/diff2html@3.4.47/node_modules/diff2html/lib-esm/diff2html.js var defaultDiff2HtmlConfig = Object.assign(Object.assign(Object.assign({}, defaultLineByLineRendererConfig), defaultSideBySideRendererConfig), { outputFormat: OutputFormatType.LINE_BY_LINE, drawFileList: true }); function html(diffInput, configuration = {}) { const config = Object.assign(Object.assign({}, defaultDiff2HtmlConfig), configuration); const diffJson = typeof diffInput === "string" ? parse(diffInput, config) : diffInput; const hoganUtils = new HoganJsUtils(config); - const fileList = config.drawFileList ? render(diffJson, hoganUtils) : ""; + const { colorScheme } = config; + const fileListRendererConfig = { colorScheme }; + const fileList = config.drawFileList ? new FileListRenderer(hoganUtils, fileListRendererConfig).render(diffJson) : ""; const diffOutput = config.outputFormat === "side-by-side" ? new SideBySideRenderer(hoganUtils, config).render(diffJson) : new LineByLineRenderer(hoganUtils, config).render(diffJson); return fileList + diffOutput; } @@ -35856,35 +36644,37 @@ var DiffView = class extends import_obsidian17.ItemView { if (((_a2 = this.state) == null ? void 0 : _a2.file) && !this.gettingDiff && this.plugin.gitManager) { this.gettingDiff = true; try { - let diff2 = await this.plugin.gitManager.getDiffString( + let diff3 = await this.plugin.gitManager.getDiffString( this.state.file, this.state.staged, this.state.hash ); this.contentEl.empty(); - if (!diff2) { + if (!diff3) { if (this.plugin.gitManager instanceof SimpleGit && await this.plugin.gitManager.isTracked( this.state.file )) { - diff2 = [ + diff3 = [ `--- ${this.state.file}`, `+++ ${this.state.file}`, "" ].join("\n"); } else { const content = await this.app.vault.adapter.read( - this.plugin.gitManager.getVaultPath(this.state.file) + this.plugin.gitManager.getRelativeVaultPath( + this.state.file + ) ); const header = `--- /dev/null +++ ${this.state.file} @@ -0,0 +1,${content.split("\n").length} @@`; - diff2 = [ + diff3 = [ ...header.split("\n"), ...content.split("\n").map((line) => `+${line}`) ].join("\n"); } } - const diffEl = this.parser.parseFromString(html(diff2), "text/html").querySelector(".d2h-file-diff"); + const diffEl = this.parser.parseFromString(html(diff3), "text/html").querySelector(".d2h-file-diff"); this.contentEl.append(diffEl); } finally { this.gettingDiff = false; @@ -35895,18 +36685,18 @@ var DiffView = class extends import_obsidian17.ItemView { // src/ui/history/historyView.ts init_polyfill_buffer(); -var import_obsidian20 = require("obsidian"); +var import_obsidian21 = require("obsidian"); // src/ui/history/historyView.svelte init_polyfill_buffer(); -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/index.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/index.js init_polyfill_buffer(); -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/animations.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/animations.js init_polyfill_buffer(); -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/utils.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/utils.js init_polyfill_buffer(); function noop() { } @@ -35930,13 +36720,13 @@ function is_empty(obj) { return Object.keys(obj).length === 0; } -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/environment.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/environment.js init_polyfill_buffer(); var is_client = typeof window !== "undefined"; var now = is_client ? () => window.performance.now() : () => Date.now(); var raf = is_client ? (cb) => requestAnimationFrame(cb) : noop; -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/loop.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/loop.js init_polyfill_buffer(); var tasks = /* @__PURE__ */ new Set(); function run_tasks(now2) { @@ -35963,23 +36753,23 @@ function loop(callback) { }; } -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/style_manager.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/style_manager.js init_polyfill_buffer(); -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/dom.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/dom.js init_polyfill_buffer(); -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/ResizeObserverSingleton.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/ResizeObserverSingleton.js init_polyfill_buffer(); -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/globals.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/globals.js init_polyfill_buffer(); var globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : ( // @ts-ignore Node typings have this global ); -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/ResizeObserverSingleton.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/ResizeObserverSingleton.js var ResizeObserverSingleton = class _ResizeObserverSingleton { /** @param {ResizeObserverOptions} options */ constructor(options) { @@ -36027,7 +36817,7 @@ var ResizeObserverSingleton = class _ResizeObserverSingleton { }; ResizeObserverSingleton.entries = "WeakMap" in globals ? /* @__PURE__ */ new WeakMap() : void 0; -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/dom.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/dom.js var is_hydrating = false; function start_hydrating() { is_hydrating = true; @@ -36153,7 +36943,7 @@ function get_custom_elements_slots(element2) { return result; } -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/style_manager.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/style_manager.js var managed_styles = /* @__PURE__ */ new Map(); var active = 0; function hash(str) { @@ -36217,16 +37007,16 @@ function clear_rules() { }); } -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/await_block.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/await_block.js init_polyfill_buffer(); -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/transitions.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/transitions.js init_polyfill_buffer(); -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/scheduler.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/scheduler.js init_polyfill_buffer(); -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/lifecycle.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/lifecycle.js init_polyfill_buffer(); var current_component; function set_current_component(component) { @@ -36247,7 +37037,7 @@ function bubble(component, event) { } } -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/scheduler.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/scheduler.js var dirty_components = []; var binding_callbacks = []; var render_callbacks = []; @@ -36322,7 +37112,7 @@ function flush_render_callbacks(fns) { render_callbacks = filtered; } -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/transitions.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/transitions.js var promise; function wait() { if (!promise) { @@ -36503,19 +37293,19 @@ function create_bidirectional_transition(node, fn, params, intro) { }; } -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/each.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/each.js init_polyfill_buffer(); function ensure_array_like(array_like_or_iterator) { return (array_like_or_iterator == null ? void 0 : array_like_or_iterator.length) !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator); } -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/spread.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/spread.js init_polyfill_buffer(); -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/ssr.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/ssr.js init_polyfill_buffer(); -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/shared/boolean_attributes.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/shared/boolean_attributes.js init_polyfill_buffer(); var _boolean_attributes = ( /** @type {const} */ @@ -36549,10 +37339,10 @@ var _boolean_attributes = ( ); var boolean_attributes = /* @__PURE__ */ new Set([..._boolean_attributes]); -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/shared/utils/names.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/shared/utils/names.js init_polyfill_buffer(); -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/Component.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/Component.js init_polyfill_buffer(); function create_component(block) { block && block.c(); @@ -36589,7 +37379,7 @@ function make_dirty(component, i) { } component.$$.dirty[i / 31 | 0] |= 1 << i % 31; } -function init2(component, options, instance10, create_fragment10, not_equal, props, append_styles2, dirty = [-1]) { +function init2(component, options, instance10, create_fragment10, not_equal, props, append_styles2 = null, dirty = [-1]) { const parent_component = current_component; set_current_component(component); const $$ = component.$$ = { @@ -36740,6 +37530,12 @@ if (typeof HTMLElement === "function") { this.$$d[name] = get_custom_element_value(name, attribute.value, this.$$p_d, "toProp"); } } + for (const key2 in this.$$p_d) { + if (!(key2 in this.$$d) && this[key2] !== void 0) { + this.$$d[key2] = this[key2]; + delete this[key2]; + } + } this.$$c = new this.$$ctor({ target: this.shadowRoot || this, props: { @@ -36762,7 +37558,7 @@ if (typeof HTMLElement === "function") { "toAttribute" ); if (attribute_value == null) { - this.removeAttribute(key2); + this.removeAttribute(this.$$p_d[key2].attribute || key2); } else { this.setAttribute(this.$$p_d[key2].attribute || key2, attribute_value); } @@ -36894,14 +37690,14 @@ var SvelteComponent = class { } }; -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/dev.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/dev.js init_polyfill_buffer(); -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/shared/version.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/shared/version.js init_polyfill_buffer(); var PUBLIC_VERSION = "4"; -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/disclose-version/index.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/internal/disclose-version/index.js init_polyfill_buffer(); if (typeof window !== "undefined") (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(PUBLIC_VERSION); @@ -36937,25 +37733,26 @@ function __awaiter(thisArg, _arguments, P, generator) { } // src/ui/history/historyView.svelte -var import_obsidian19 = require("obsidian"); +var import_obsidian20 = require("obsidian"); -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/index.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/index.js init_polyfill_buffer(); // src/ui/history/components/logComponent.svelte init_polyfill_buffer(); +var import_obsidian19 = require("obsidian"); -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/transition/index.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/transition/index.js init_polyfill_buffer(); -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/easing/index.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/easing/index.js init_polyfill_buffer(); function cubicOut(t) { const f = t - 1; return f * f * f + 1; } -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/transition/index.js +// node_modules/.pnpm/svelte@4.2.10/node_modules/svelte/src/runtime/transition/index.js function slide(node, { delay: delay2 = 0, duration = 400, easing = cubicOut, axis = "y" } = {}) { const style = getComputedStyle(node); const opacity = +style.opacity; @@ -37084,12 +37881,6 @@ function create_fragment(ctx) { attr(div3, "class", "tree-item-self is-clickable nav-file-title svelte-1wbh8tp"); attr(div3, "data-path", div3_data_path_value = /*diff*/ ctx[0].vault_path); - attr( - div3, - "aria-label-position", - /*side*/ - ctx[3] - ); attr( div3, "data-tooltip-position", @@ -37183,15 +37974,6 @@ function create_fragment(ctx) { attr(div3, "data-path", div3_data_path_value); } if (dirty & /*side*/ - 8) { - attr( - div3, - "aria-label-position", - /*side*/ - ctx2[3] - ); - } - if (dirty & /*side*/ 8) { attr( div3, @@ -37232,13 +38014,13 @@ function create_fragment(ctx) { } function instance($$self, $$props, $$invalidate) { let side; - let { diff: diff2 } = $$props; + let { diff: diff3 } = $$props; let { view } = $$props; let buttons = []; window.setTimeout(() => buttons.forEach((b) => (0, import_obsidian18.setIcon)(b, b.getAttr("data-icon"))), 0); function open(event) { var _a2; - const file = view.app.vault.getAbstractFileByPath(diff2.vault_path); + const file = view.app.vault.getAbstractFileByPath(diff3.vault_path); if (file instanceof import_obsidian18.TFile) { (_a2 = getNewLeaf(event)) === null || _a2 === void 0 ? void 0 : _a2.openFile(file); } @@ -37249,9 +38031,9 @@ function instance($$self, $$props, $$invalidate) { type: DIFF_VIEW_CONFIG.type, active: true, state: { - file: diff2.path, + file: diff3.path, staged: false, - hash: diff2.hash + hash: diff3.hash } }); } @@ -37266,7 +38048,7 @@ function instance($$self, $$props, $$invalidate) { } $$self.$$set = ($$props2) => { if ("diff" in $$props2) - $$invalidate(0, diff2 = $$props2.diff); + $$invalidate(0, diff3 = $$props2.diff); if ("view" in $$props2) $$invalidate(1, view = $$props2.view); }; @@ -37277,7 +38059,7 @@ function instance($$self, $$props, $$invalidate) { $$invalidate(3, side = view.leaf.getRoot().side == "left" ? "right" : "left"); } }; - return [diff2, view, buttons, side, open, showDiff, focus_handler, div_binding]; + return [diff3, view, buttons, side, open, showDiff, focus_handler, div_binding]; } var LogFileComponent = class extends SvelteComponent { constructor(options) { @@ -37360,12 +38142,6 @@ function create_else_block(ctx) { ); attr(div2, "class", "tree-item-inner nav-folder-title-content svelte-1lnl15d"); attr(div3, "class", "tree-item-self is-clickable nav-folder-title"); - attr( - div3, - "aria-label-position", - /*side*/ - ctx[5] - ); attr( div3, "data-tooltip-position", @@ -37423,15 +38199,6 @@ function create_else_block(ctx) { ctx[8].title + "")) set_data(t2, t2_value); if (!current || dirty & /*side*/ - 32) { - attr( - div3, - "aria-label-position", - /*side*/ - ctx[5] - ); - } - if (!current || dirty & /*side*/ 32) { attr( div3, @@ -37859,15 +38626,12 @@ var LogTreeComponent = class extends SvelteComponent { var logTreeComponent_default = LogTreeComponent; // src/ui/history/components/logComponent.svelte -function add_css3(target) { - append_styles(target, "svelte-1t6egnt", ".git-ref.svelte-1t6egnt{color:var(--text-accent)}"); -} function get_each_context2(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[8] = list[i]; + child_ctx[9] = list[i]; return child_ctx; } -function create_if_block_2(ctx) { +function create_if_block_4(ctx) { let div; let t_value = ( /*log*/ @@ -37878,7 +38642,7 @@ function create_if_block_2(ctx) { c() { div = element("div"); t = text(t_value); - attr(div, "class", "git-ref svelte-1t6egnt"); + attr(div, "class", "git-ref"); }, m(target, anchor) { insert(target, div, anchor); @@ -37897,6 +38661,80 @@ function create_if_block_2(ctx) { } }; } +function create_if_block_3(ctx) { + let div; + let t_value = ( + /*authorToString*/ + ctx[7]( + /*log*/ + ctx[0] + ) + "" + ); + let t; + return { + c() { + div = element("div"); + t = text(t_value); + attr(div, "class", "git-author"); + }, + m(target, anchor) { + insert(target, div, anchor); + append2(div, t); + }, + p(ctx2, dirty) { + if (dirty & /*log*/ + 1 && t_value !== (t_value = /*authorToString*/ + ctx2[7]( + /*log*/ + ctx2[0] + ) + "")) + set_data(t, t_value); + }, + d(detaching) { + if (detaching) { + detach(div); + } + } + }; +} +function create_if_block_2(ctx) { + let div; + let t_value = (0, import_obsidian19.moment)( + /*log*/ + ctx[0].date + ).format( + /*plugin*/ + ctx[3].settings.commitDateFormat + ) + ""; + let t; + return { + c() { + div = element("div"); + t = text(t_value); + attr(div, "class", "git-date"); + }, + m(target, anchor) { + insert(target, div, anchor); + append2(div, t); + }, + p(ctx2, dirty) { + if (dirty & /*log, plugin*/ + 9 && t_value !== (t_value = (0, import_obsidian19.moment)( + /*log*/ + ctx2[0].date + ).format( + /*plugin*/ + ctx2[3].settings.commitDateFormat + ) + "")) + set_data(t, t_value); + }, + d(detaching) { + if (detaching) { + detach(div); + } + } + }; +} function create_if_block3(ctx) { let div; let current_block_type_index; @@ -38132,7 +38970,7 @@ function create_each_block2(ctx) { ), diff: ( /*file*/ - ctx[8] + ctx[9] ) } }); @@ -38153,7 +38991,7 @@ function create_each_block2(ctx) { if (dirty & /*log*/ 1) logfilecomponent_changes.diff = /*file*/ - ctx2[8]; + ctx2[9]; logfilecomponent.$set(logfilecomponent_changes); }, i(local) { @@ -38172,6 +39010,7 @@ function create_each_block2(ctx) { }; } function create_fragment3(ctx) { + var _a2; let main; let div4; let div3; @@ -38179,25 +39018,37 @@ function create_fragment3(ctx) { let t0; let div2; let t1; + let t2; + let t3; let div1; - let t2_value = ( + let t4_value = ( /*log*/ ctx[0].message + "" ); - let t2; - let div1_aria_label_value; - let t3; + let t4; + let div3_aria_label_value; + let t5; let current; let mounted; let dispose; let if_block0 = ( /*log*/ - ctx[0].refs.length > 0 && create_if_block_2(ctx) + ctx[0].refs.length > 0 && create_if_block_4(ctx) ); - let if_block1 = !/*isCollapsed*/ + let if_block1 = ( + /*plugin*/ + ctx[3].settings.authorInHistoryView != "hide" && /*log*/ + ((_a2 = ctx[0].author) == null ? void 0 : _a2.name) && create_if_block_3(ctx) + ); + let if_block2 = ( + /*plugin*/ + ctx[3].settings.dateInHistoryView && create_if_block_2(ctx) + ); + let if_block3 = !/*isCollapsed*/ ctx[4] && create_if_block3(ctx); return { c() { + var _a3; main = element("main"); div4 = element("div"); div3 = element("div"); @@ -38208,11 +39059,17 @@ function create_fragment3(ctx) { if (if_block0) if_block0.c(); t1 = space(); - div1 = element("div"); - t2 = text(t2_value); - t3 = space(); if (if_block1) if_block1.c(); + t2 = space(); + if (if_block2) + if_block2.c(); + t3 = space(); + div1 = element("div"); + t4 = text(t4_value); + t5 = space(); + if (if_block3) + if_block3.c(); attr(div0, "class", "tree-item-icon nav-folder-collapse-indicator collapse-icon"); toggle_class( div0, @@ -38221,21 +39078,28 @@ function create_fragment3(ctx) { ctx[4] ); attr(div1, "class", "tree-item-inner nav-folder-title-content"); - attr(div1, "aria-label", div1_aria_label_value = /*log*/ - ctx[0].message); + attr(div3, "class", "tree-item-self is-clickable nav-folder-title"); + attr(div3, "aria-label", div3_aria_label_value = `${/*log*/ + ctx[0].refs.length > 0 ? ( + /*log*/ + ctx[0].refs.join(", ") + "\n" + ) : ""}${/*log*/ + (_a3 = ctx[0].author) == null ? void 0 : _a3.name} +${(0, import_obsidian19.moment)( + /*log*/ + ctx[0].date + ).format( + /*plugin*/ + ctx[3].settings.commitDateFormat + )} +${/*log*/ + ctx[0].message}`); attr( - div1, - "aria-label-position", - /*side*/ - ctx[5] - ); - attr( - div1, + div3, "data-tooltip-position", /*side*/ ctx[5] ); - attr(div3, "class", "tree-item-self is-clickable nav-folder-title"); attr(div4, "class", "tree-item nav-folder"); toggle_class( div4, @@ -38254,23 +39118,30 @@ function create_fragment3(ctx) { if (if_block0) if_block0.m(div2, null); append2(div2, t1); - append2(div2, div1); - append2(div1, t2); - append2(div4, t3); if (if_block1) - if_block1.m(div4, null); + if_block1.m(div2, null); + append2(div2, t2); + if (if_block2) + if_block2.m(div2, null); + append2(div2, t3); + append2(div2, div1); + append2(div1, t4); + append2(div4, t5); + if (if_block3) + if_block3.m(div4, null); current = true; if (!mounted) { dispose = listen( div3, "click", /*click_handler*/ - ctx[7] + ctx[8] ); mounted = true; } }, p(ctx2, [dirty]) { + var _a3, _b; if (!current || dirty & /*isCollapsed*/ 16) { toggle_class( @@ -38287,7 +39158,7 @@ function create_fragment3(ctx) { if (if_block0) { if_block0.p(ctx2, dirty); } else { - if_block0 = create_if_block_2(ctx2); + if_block0 = create_if_block_4(ctx2); if_block0.c(); if_block0.m(div2, t1); } @@ -38295,28 +39166,63 @@ function create_fragment3(ctx) { if_block0.d(1); if_block0 = null; } + if ( + /*plugin*/ + ctx2[3].settings.authorInHistoryView != "hide" && /*log*/ + ((_a3 = ctx2[0].author) == null ? void 0 : _a3.name) + ) { + if (if_block1) { + if_block1.p(ctx2, dirty); + } else { + if_block1 = create_if_block_3(ctx2); + if_block1.c(); + if_block1.m(div2, t2); + } + } else if (if_block1) { + if_block1.d(1); + if_block1 = null; + } + if ( + /*plugin*/ + ctx2[3].settings.dateInHistoryView + ) { + if (if_block2) { + if_block2.p(ctx2, dirty); + } else { + if_block2 = create_if_block_2(ctx2); + if_block2.c(); + if_block2.m(div2, t3); + } + } else if (if_block2) { + if_block2.d(1); + if_block2 = null; + } if ((!current || dirty & /*log*/ - 1) && t2_value !== (t2_value = /*log*/ + 1) && t4_value !== (t4_value = /*log*/ ctx2[0].message + "")) - set_data(t2, t2_value); - if (!current || dirty & /*log*/ - 1 && div1_aria_label_value !== (div1_aria_label_value = /*log*/ - ctx2[0].message)) { - attr(div1, "aria-label", div1_aria_label_value); + set_data(t4, t4_value); + if (!current || dirty & /*log, plugin*/ + 9 && div3_aria_label_value !== (div3_aria_label_value = `${/*log*/ + ctx2[0].refs.length > 0 ? ( + /*log*/ + ctx2[0].refs.join(", ") + "\n" + ) : ""}${/*log*/ + (_b = ctx2[0].author) == null ? void 0 : _b.name} +${(0, import_obsidian19.moment)( + /*log*/ + ctx2[0].date + ).format( + /*plugin*/ + ctx2[3].settings.commitDateFormat + )} +${/*log*/ + ctx2[0].message}`)) { + attr(div3, "aria-label", div3_aria_label_value); } if (!current || dirty & /*side*/ 32) { attr( - div1, - "aria-label-position", - /*side*/ - ctx2[5] - ); - } - if (!current || dirty & /*side*/ - 32) { - attr( - div1, + div3, "data-tooltip-position", /*side*/ ctx2[5] @@ -38324,22 +39230,22 @@ function create_fragment3(ctx) { } if (!/*isCollapsed*/ ctx2[4]) { - if (if_block1) { - if_block1.p(ctx2, dirty); + if (if_block3) { + if_block3.p(ctx2, dirty); if (dirty & /*isCollapsed*/ 16) { - transition_in(if_block1, 1); + transition_in(if_block3, 1); } } else { - if_block1 = create_if_block3(ctx2); - if_block1.c(); - transition_in(if_block1, 1); - if_block1.m(div4, null); + if_block3 = create_if_block3(ctx2); + if_block3.c(); + transition_in(if_block3, 1); + if_block3.m(div4, null); } - } else if (if_block1) { + } else if (if_block3) { group_outros(); - transition_out(if_block1, 1, 1, () => { - if_block1 = null; + transition_out(if_block3, 1, 1, () => { + if_block3 = null; }); check_outros(); } @@ -38356,11 +39262,11 @@ function create_fragment3(ctx) { i(local) { if (current) return; - transition_in(if_block1); + transition_in(if_block3); current = true; }, o(local) { - transition_out(if_block1); + transition_out(if_block3); current = false; }, d(detaching) { @@ -38371,6 +39277,10 @@ function create_fragment3(ctx) { if_block0.d(); if (if_block1) if_block1.d(); + if (if_block2) + if_block2.d(); + if (if_block3) + if_block3.d(); mounted = false; dispose(); } @@ -38384,6 +39294,15 @@ function instance3($$self, $$props, $$invalidate) { let { showTree } = $$props; let { plugin } = $$props; let isCollapsed = true; + function authorToString(log3) { + const name = log3.author.name; + if (plugin.settings.authorInHistoryView == "full") { + return name; + } else if (plugin.settings.authorInHistoryView == "initials") { + const words = name.split(" ").filter((word) => word.length > 0); + return words.map((word) => word[0].toUpperCase()).join(""); + } + } const click_handler = () => $$invalidate(4, isCollapsed = !isCollapsed); $$self.$$set = ($$props2) => { if ("log" in $$props2) @@ -38412,12 +39331,22 @@ function instance3($$self, $$props, $$invalidate) { $$invalidate(5, side = view.leaf.getRoot().side == "left" ? "right" : "left"); } }; - return [log2, view, showTree, plugin, isCollapsed, side, logsHierarchy, click_handler]; + return [ + log2, + view, + showTree, + plugin, + isCollapsed, + side, + logsHierarchy, + authorToString, + click_handler + ]; } var LogComponent = class extends SvelteComponent { constructor(options) { super(); - init2(this, options, instance3, create_fragment3, safe_not_equal, { log: 0, view: 1, showTree: 2, plugin: 3 }, add_css3); + init2(this, options, instance3, create_fragment3, safe_not_equal, { log: 0, view: 1, showTree: 2, plugin: 3 }); } }; var logComponent_default = LogComponent; @@ -38725,8 +39654,8 @@ function instance4($$self, $$props, $$invalidate) { plugin.app.workspace.onLayoutReady(() => { window.setTimeout( () => { - buttons.forEach((btn) => (0, import_obsidian19.setIcon)(btn, btn.getAttr("data-icon"), 16)); - (0, import_obsidian19.setIcon)(layoutBtn, showTree ? "list" : "folder", 16); + buttons.forEach((btn) => (0, import_obsidian20.setIcon)(btn, btn.getAttr("data-icon"))); + (0, import_obsidian20.setIcon)(layoutBtn, showTree ? "list" : "folder"); }, 0 ); @@ -38771,7 +39700,7 @@ function instance4($$self, $$props, $$invalidate) { $: { if (layoutBtn) { layoutBtn.empty(); - (0, import_obsidian19.setIcon)(layoutBtn, showTree ? "list" : "folder", 16); + (0, import_obsidian20.setIcon)(layoutBtn, showTree ? "list" : "folder"); } } } @@ -38798,7 +39727,7 @@ var HistoryView = class extends SvelteComponent { var historyView_default = HistoryView; // src/ui/history/historyView.ts -var HistoryView2 = class extends import_obsidian20.ItemView { +var HistoryView2 = class extends import_obsidian21.ItemView { constructor(leaf, plugin) { super(leaf); this.plugin = plugin; @@ -38830,8 +39759,8 @@ var HistoryView2 = class extends import_obsidian20.ItemView { // src/ui/modals/branchModal.ts init_polyfill_buffer(); -var import_obsidian21 = require("obsidian"); -var BranchModal = class extends import_obsidian21.FuzzySuggestModal { +var import_obsidian22 = require("obsidian"); +var BranchModal = class extends import_obsidian22.FuzzySuggestModal { constructor(branches) { super(app); this.branches = branches; @@ -38861,8 +39790,8 @@ var BranchModal = class extends import_obsidian21.FuzzySuggestModal { // src/ui/modals/ignoreModal.ts init_polyfill_buffer(); -var import_obsidian22 = require("obsidian"); -var IgnoreModal = class extends import_obsidian22.Modal { +var import_obsidian23 = require("obsidian"); +var IgnoreModal = class extends import_obsidian23.Modal { constructor(app2, content) { super(app2); this.content = content; @@ -38900,16 +39829,16 @@ var IgnoreModal = class extends import_obsidian22.Modal { // src/ui/sourceControl/sourceControl.ts init_polyfill_buffer(); -var import_obsidian29 = require("obsidian"); +var import_obsidian30 = require("obsidian"); // src/ui/sourceControl/sourceControl.svelte init_polyfill_buffer(); -var import_obsidian28 = require("obsidian"); +var import_obsidian29 = require("obsidian"); // src/ui/modals/discardModal.ts init_polyfill_buffer(); -var import_obsidian23 = require("obsidian"); -var DiscardModal = class extends import_obsidian23.Modal { +var import_obsidian24 = require("obsidian"); +var DiscardModal = class extends import_obsidian24.Modal { constructor(app2, deletion, filename) { super(app2); this.deletion = deletion; @@ -38965,15 +39894,15 @@ var DiscardModal = class extends import_obsidian23.Modal { // src/ui/sourceControl/components/fileComponent.svelte init_polyfill_buffer(); -var import_obsidian25 = require("obsidian"); +var import_obsidian26 = require("obsidian"); -// node_modules/.pnpm/github.com+Vinzent03+obsidian-community-lib@e663de4f95c879b40613090da78ea599ff621d24_@codemir_kbfcpig3uak7df3ohthcqq53p4/node_modules/obsidian-community-lib/dist/index.js +// node_modules/.pnpm/github.com+Vinzent03+obsidian-community-lib@e663de4f95c879b40613090da78ea599ff621d24_@codemir_xyncsguozhhawq25qkwtwp76my/node_modules/obsidian-community-lib/dist/index.js init_polyfill_buffer(); -// node_modules/.pnpm/github.com+Vinzent03+obsidian-community-lib@e663de4f95c879b40613090da78ea599ff621d24_@codemir_kbfcpig3uak7df3ohthcqq53p4/node_modules/obsidian-community-lib/dist/utils.js +// node_modules/.pnpm/github.com+Vinzent03+obsidian-community-lib@e663de4f95c879b40613090da78ea599ff621d24_@codemir_xyncsguozhhawq25qkwtwp76my/node_modules/obsidian-community-lib/dist/utils.js init_polyfill_buffer(); var feather = __toESM(require_feather()); -var import_obsidian24 = require("obsidian"); +var import_obsidian25 = require("obsidian"); function hoverPreview(event, view, to) { const targetEl = event.target; app.workspace.trigger("hover-link", { @@ -38986,7 +39915,7 @@ function hoverPreview(event, view, to) { } // src/ui/sourceControl/components/fileComponent.svelte -function add_css4(target) { +function add_css3(target) { append_styles(target, "svelte-1wbh8tp", "main.svelte-1wbh8tp .nav-file-title.svelte-1wbh8tp{align-items:center}"); } function create_if_block5(ctx) { @@ -39098,12 +40027,6 @@ function create_fragment5(ctx) { attr(div6, "class", "tree-item-self is-clickable nav-file-title svelte-1wbh8tp"); attr(div6, "data-path", div6_data_path_value = /*change*/ ctx[0].vault_path); - attr( - div6, - "aria-label-position", - /*side*/ - ctx[3] - ); attr( div6, "data-tooltip-position", @@ -39218,15 +40141,6 @@ function create_fragment5(ctx) { attr(div6, "data-path", div6_data_path_value); } if (dirty & /*side*/ - 8) { - attr( - div6, - "aria-label-position", - /*side*/ - ctx2[3] - ); - } - if (dirty & /*side*/ 8) { attr( div6, @@ -39274,7 +40188,7 @@ function instance5($$self, $$props, $$invalidate) { let { view } = $$props; let { manager } = $$props; let buttons = []; - window.setTimeout(() => buttons.forEach((b) => (0, import_obsidian25.setIcon)(b, b.getAttr("data-icon"))), 0); + window.setTimeout(() => buttons.forEach((b) => (0, import_obsidian26.setIcon)(b, b.getAttr("data-icon"))), 0); function hover(event) { if (app.vault.getAbstractFileByPath(change.vault_path)) { hoverPreview(event, view, change.vault_path); @@ -39284,7 +40198,7 @@ function instance5($$self, $$props, $$invalidate) { var _a2; const file = view.app.vault.getAbstractFileByPath(change.vault_path); console.log(event); - if (file instanceof import_obsidian25.TFile) { + if (file instanceof import_obsidian26.TFile) { (_a2 = getNewLeaf(event)) === null || _a2 === void 0 ? void 0 : _a2.openFile(file); } } @@ -39373,15 +40287,15 @@ function instance5($$self, $$props, $$invalidate) { var FileComponent = class extends SvelteComponent { constructor(options) { super(); - init2(this, options, instance5, create_fragment5, safe_not_equal, { change: 0, view: 1, manager: 9 }, add_css4); + init2(this, options, instance5, create_fragment5, safe_not_equal, { change: 0, view: 1, manager: 9 }, add_css3); } }; var fileComponent_default = FileComponent; // src/ui/sourceControl/components/pulledFileComponent.svelte init_polyfill_buffer(); -var import_obsidian26 = require("obsidian"); -function add_css5(target) { +var import_obsidian27 = require("obsidian"); +function add_css4(target) { append_styles(target, "svelte-1wbh8tp", "main.svelte-1wbh8tp .nav-file-title.svelte-1wbh8tp{align-items:center}"); } function create_fragment6(ctx) { @@ -39424,12 +40338,6 @@ function create_fragment6(ctx) { attr(div2, "class", "tree-item-self is-clickable nav-file-title svelte-1wbh8tp"); attr(div2, "data-path", div2_data_path_value = /*change*/ ctx[0].vault_path); - attr( - div2, - "aria-label-position", - /*side*/ - ctx[1] - ); attr( div2, "data-tooltip-position", @@ -39497,15 +40405,6 @@ function create_fragment6(ctx) { attr(div2, "data-path", div2_data_path_value); } if (dirty & /*side*/ - 2) { - attr( - div2, - "aria-label-position", - /*side*/ - ctx2[1] - ); - } - if (dirty & /*side*/ 2) { attr( div2, @@ -39543,7 +40442,7 @@ function instance6($$self, $$props, $$invalidate) { function open(event) { var _a2; const file = view.app.vault.getAbstractFileByPath(change.vault_path); - if (file instanceof import_obsidian26.TFile) { + if (file instanceof import_obsidian27.TFile) { (_a2 = getNewLeaf(event)) === null || _a2 === void 0 ? void 0 : _a2.openFile(file); } } @@ -39568,15 +40467,15 @@ function instance6($$self, $$props, $$invalidate) { var PulledFileComponent = class extends SvelteComponent { constructor(options) { super(); - init2(this, options, instance6, create_fragment6, safe_not_equal, { change: 0, view: 4 }, add_css5); + init2(this, options, instance6, create_fragment6, safe_not_equal, { change: 0, view: 4 }, add_css4); } }; var pulledFileComponent_default = PulledFileComponent; // src/ui/sourceControl/components/stagedFileComponent.svelte init_polyfill_buffer(); -var import_obsidian27 = require("obsidian"); -function add_css6(target) { +var import_obsidian28 = require("obsidian"); +function add_css5(target) { append_styles(target, "svelte-1wbh8tp", "main.svelte-1wbh8tp .nav-file-title.svelte-1wbh8tp{align-items:center}"); } function create_if_block6(ctx) { @@ -39675,12 +40574,6 @@ function create_fragment7(ctx) { attr(div5, "class", "tree-item-self is-clickable nav-file-title svelte-1wbh8tp"); attr(div5, "data-path", div5_data_path_value = /*change*/ ctx[0].vault_path); - attr( - div5, - "aria-label-position", - /*side*/ - ctx[3] - ); attr( div5, "data-tooltip-position", @@ -39788,15 +40681,6 @@ function create_fragment7(ctx) { attr(div5, "data-path", div5_data_path_value); } if (dirty & /*side*/ - 8) { - attr( - div5, - "aria-label-position", - /*side*/ - ctx2[3] - ); - } - if (dirty & /*side*/ 8) { attr( div5, @@ -39843,7 +40727,7 @@ function instance7($$self, $$props, $$invalidate) { let { view } = $$props; let { manager } = $$props; let buttons = []; - window.setTimeout(() => buttons.forEach((b) => (0, import_obsidian27.setIcon)(b, b.getAttr("data-icon"), 16)), 0); + window.setTimeout(() => buttons.forEach((b) => (0, import_obsidian28.setIcon)(b, b.getAttr("data-icon"))), 0); function hover(event) { if (app.vault.getAbstractFileByPath(change.vault_path)) { hoverPreview(event, view, change.vault_path); @@ -39852,7 +40736,7 @@ function instance7($$self, $$props, $$invalidate) { function open(event) { var _a2; const file = view.app.vault.getAbstractFileByPath(change.vault_path); - if (file instanceof import_obsidian27.TFile) { + if (file instanceof import_obsidian28.TFile) { (_a2 = getNewLeaf(event)) === null || _a2 === void 0 ? void 0 : _a2.openFile(file); } } @@ -39917,14 +40801,14 @@ function instance7($$self, $$props, $$invalidate) { var StagedFileComponent = class extends SvelteComponent { constructor(options) { super(); - init2(this, options, instance7, create_fragment7, safe_not_equal, { change: 0, view: 1, manager: 8 }, add_css6); + init2(this, options, instance7, create_fragment7, safe_not_equal, { change: 0, view: 1, manager: 8 }, add_css5); } }; var stagedFileComponent_default = StagedFileComponent; // src/ui/sourceControl/components/treeComponent.svelte init_polyfill_buffer(); -function add_css7(target) { +function add_css6(target) { append_styles(target, "svelte-hup5mn", "main.svelte-hup5mn .nav-folder-title.svelte-hup5mn{align-items:center}"); } function get_each_context4(ctx, list, i) { @@ -39970,7 +40854,7 @@ function create_else_block3(ctx) { ctx[5][ /*entity*/ ctx[15].title - ] && create_if_block_4(ctx); + ] && create_if_block_42(ctx); function click_handler_3() { return ( /*click_handler_3*/ @@ -40019,12 +40903,6 @@ function create_else_block3(ctx) { attr(div4, "class", "buttons"); attr(div5, "class", "git-tools"); attr(div6, "class", "tree-item-self is-clickable nav-folder-title svelte-hup5mn"); - attr( - div6, - "aria-label-position", - /*side*/ - ctx[6] - ); attr( div6, "data-tooltip-position", @@ -40065,7 +40943,7 @@ function create_else_block3(ctx) { append2(div7, t6); current = true; if (!mounted) { - dispose = listen(div7, "click", click_handler_3); + dispose = listen(div7, "click", stop_propagation(click_handler_3)); mounted = true; } }, @@ -40098,15 +40976,6 @@ function create_else_block3(ctx) { } } if (!current || dirty & /*side*/ - 64) { - attr( - div6, - "aria-label-position", - /*side*/ - ctx[6] - ); - } - if (!current || dirty & /*side*/ 64) { attr( div6, @@ -40132,7 +41001,7 @@ function create_else_block3(ctx) { transition_in(if_block1, 1); } } else { - if_block1 = create_if_block_4(ctx); + if_block1 = create_if_block_42(ctx); if_block1.c(); transition_in(if_block1, 1); if_block1.m(div7, t6); @@ -40185,7 +41054,7 @@ function create_if_block7(ctx) { let if_block; let t; let current; - const if_block_creators = [create_if_block_13, create_if_block_22, create_if_block_3]; + const if_block_creators = [create_if_block_13, create_if_block_22, create_if_block_32]; const if_blocks = []; function select_block_type_1(ctx2, dirty) { if ( @@ -40377,7 +41246,7 @@ function create_if_block_5(ctx) { } }; } -function create_if_block_4(ctx) { +function create_if_block_42(ctx) { let div; let treecomponent; let div_transition; @@ -40467,7 +41336,7 @@ function create_if_block_4(ctx) { } }; } -function create_if_block_3(ctx) { +function create_if_block_32(ctx) { let pulledfilecomponent; let current; pulledfilecomponent = new pulledFileComponent_default({ @@ -40886,15 +41755,15 @@ var TreeComponent = class extends SvelteComponent { fileType: 3, topLevel: 4 }, - add_css7 + add_css6 ); } }; var treeComponent_default = TreeComponent; // src/ui/sourceControl/sourceControl.svelte -function add_css8(target) { - append_styles(target, "svelte-1bvmxec", `.commit-msg-input.svelte-1bvmxec.svelte-1bvmxec{width:100%;overflow:hidden;resize:none;padding:7px 5px;background-color:var(--background-modifier-form-field)}.git-commit-msg.svelte-1bvmxec.svelte-1bvmxec{position:relative;padding:0;width:calc(100% - var(--size-4-8));margin:4px auto}main.svelte-1bvmxec .git-tools .files-count.svelte-1bvmxec{padding-left:var(--size-2-1);width:11px;display:flex;align-items:center;justify-content:center}.nav-folder-title.svelte-1bvmxec.svelte-1bvmxec{align-items:center}.git-commit-msg-clear-button.svelte-1bvmxec.svelte-1bvmxec{position:absolute;background:transparent;border-radius:50%;color:var(--search-clear-button-color);cursor:var(--cursor);top:-4px;right:2px;bottom:0px;line-height:0;height:var(--input-height);width:28px;margin:auto;padding:0 0;text-align:center;display:flex;justify-content:center;align-items:center;transition:color 0.15s ease-in-out}.git-commit-msg-clear-button.svelte-1bvmxec.svelte-1bvmxec:after{content:"";height:var(--search-clear-button-size);width:var(--search-clear-button-size);display:block;background-color:currentColor;-webkit-mask-image:url("data:image/svg+xml,");-webkit-mask-repeat:no-repeat}`); +function add_css7(target) { + append_styles(target, "svelte-11adhly", `.commit-msg-input.svelte-11adhly.svelte-11adhly{width:100%;overflow:hidden;resize:none;padding:7px 5px;background-color:var(--background-modifier-form-field)}.git-commit-msg.svelte-11adhly.svelte-11adhly{position:relative;padding:0;width:calc(100% - var(--size-4-8));margin:4px auto}main.svelte-11adhly .git-tools .files-count.svelte-11adhly{padding-left:var(--size-2-1);width:11px;display:flex;align-items:center;justify-content:center}.nav-folder-title.svelte-11adhly.svelte-11adhly{align-items:center}.git-commit-msg-clear-button.svelte-11adhly.svelte-11adhly{position:absolute;background:transparent;border-radius:50%;color:var(--search-clear-button-color);cursor:var(--cursor);top:-4px;right:2px;bottom:0px;line-height:0;height:var(--input-height);width:28px;margin:auto;padding:0 0;text-align:center;display:flex;justify-content:center;align-items:center;transition:color 0.15s ease-in-out}.git-commit-msg-clear-button.svelte-11adhly.svelte-11adhly:after{content:"";height:var(--search-clear-button-size);width:var(--search-clear-button-size);display:block;background-color:currentColor;mask-image:url("data:image/svg+xml,");mask-repeat:no-repeat;-webkit-mask-image:url("data:image/svg+xml,");-webkit-mask-repeat:no-repeat}`); } function get_each_context5(ctx, list, i) { const child_ctx = ctx.slice(); @@ -40919,7 +41788,7 @@ function create_if_block_8(ctx) { return { c() { div = element("div"); - attr(div, "class", "git-commit-msg-clear-button svelte-1bvmxec"); + attr(div, "class", "git-commit-msg-clear-button svelte-11adhly"); attr(div, "aria-label", div_aria_label_value = "Clear"); }, m(target, anchor) { @@ -40994,7 +41863,7 @@ function create_if_block8(ctx) { ); let if_block1 = ( /*changesOpen*/ - ctx[12] && create_if_block_42(ctx) + ctx[12] && create_if_block_43(ctx) ); let if_block2 = ( /*lastPulledFiles*/ @@ -41055,9 +41924,9 @@ function create_if_block8(ctx) { attr(div2, "aria-label", "Unstage"); attr(div2, "class", "clickable-icon"); attr(div3, "class", "buttons"); - attr(div4, "class", "files-count svelte-1bvmxec"); + attr(div4, "class", "files-count svelte-11adhly"); attr(div5, "class", "git-tools"); - attr(div6, "class", "tree-item-self is-clickable nav-folder-title svelte-1bvmxec"); + attr(div6, "class", "tree-item-self is-clickable nav-folder-title svelte-11adhly"); attr(div7, "class", "staged tree-item nav-folder"); toggle_class(div7, "is-collapsed", !/*stagedOpen*/ ctx[13]); @@ -41072,9 +41941,9 @@ function create_if_block8(ctx) { attr(div11, "aria-label", "Stage"); attr(div11, "class", "clickable-icon"); attr(div12, "class", "buttons"); - attr(div13, "class", "files-count svelte-1bvmxec"); + attr(div13, "class", "files-count svelte-11adhly"); attr(div14, "class", "git-tools"); - attr(div15, "class", "tree-item-self is-clickable nav-folder-title svelte-1bvmxec"); + attr(div15, "class", "tree-item-self is-clickable nav-folder-title svelte-11adhly"); attr(div16, "class", "changes tree-item nav-folder"); toggle_class(div16, "is-collapsed", !/*changesOpen*/ ctx[12]); @@ -41211,7 +42080,7 @@ function create_if_block8(ctx) { transition_in(if_block1, 1); } } else { - if_block1 = create_if_block_42(ctx2); + if_block1 = create_if_block_43(ctx2); if_block1.c(); transition_in(if_block1, 1); if_block1.m(div16, null); @@ -41566,7 +42435,7 @@ function create_each_block_2(ctx) { } }; } -function create_if_block_42(ctx) { +function create_if_block_43(ctx) { let div; let current_block_type_index; let if_block; @@ -41889,7 +42758,7 @@ function create_if_block_14(ctx) { attr(div0, "class", "tree-item-icon nav-folder-collapse-indicator collapse-icon"); attr(div1, "class", "tree-item-inner nav-folder-title-content"); attr(span, "class", "tree-item-flair"); - attr(div2, "class", "tree-item-self is-clickable nav-folder-title svelte-1bvmxec"); + attr(div2, "class", "tree-item-self is-clickable nav-folder-title svelte-11adhly"); attr(div3, "class", "pulled nav-folder"); toggle_class(div3, "is-collapsed", !/*lastPulledFilesOpen*/ ctx[14]); @@ -41978,7 +42847,7 @@ function create_if_block_23(ctx) { let if_block; let div_transition; let current; - const if_block_creators = [create_if_block_32, create_else_block4]; + const if_block_creators = [create_if_block_33, create_else_block4]; const if_blocks = []; function select_block_type_2(ctx2, dirty) { if ( @@ -42137,7 +43006,7 @@ function create_else_block4(ctx) { } }; } -function create_if_block_32(ctx) { +function create_if_block_33(ctx) { let treecomponent; let current; treecomponent = new treeComponent_default({ @@ -42363,14 +43232,14 @@ function create_fragment9(ctx) { /*rows*/ ctx[15] ); - attr(textarea, "class", "commit-msg-input svelte-1bvmxec"); + attr(textarea, "class", "commit-msg-input svelte-11adhly"); attr(textarea, "spellcheck", "true"); attr(textarea, "placeholder", "Commit Message"); - attr(div10, "class", "git-commit-msg svelte-1bvmxec"); + attr(div10, "class", "git-commit-msg svelte-11adhly"); attr(div11, "class", "nav-files-container"); set_style(div11, "position", "relative"); attr(main, "data-type", main_data_type_value = SOURCE_CONTROL_VIEW_CONFIG.type); - attr(main, "class", "svelte-1bvmxec"); + attr(main, "class", "svelte-11adhly"); }, m(target, anchor) { insert(target, main, anchor); @@ -42593,8 +43462,8 @@ function instance9($$self, $$props, $$invalidate) { plugin.app.workspace.onLayoutReady(() => { window.setTimeout( () => { - buttons.forEach((btn) => (0, import_obsidian28.setIcon)(btn, btn.getAttr("data-icon"))); - (0, import_obsidian28.setIcon)(layoutBtn, showTree ? "list" : "folder"); + buttons.forEach((btn) => (0, import_obsidian29.setIcon)(btn, btn.getAttr("data-icon"))); + (0, import_obsidian29.setIcon)(layoutBtn, showTree ? "list" : "folder"); }, 0 ); @@ -42610,7 +43479,7 @@ function instance9($$self, $$props, $$invalidate) { plugin.setState(0 /* idle */); return false; } - plugin.promiseQueue.addTask(() => plugin.gitManager.commit(commitMessage).then(() => { + plugin.promiseQueue.addTask(() => plugin.gitManager.commit({ message: commitMessage }).then(() => { if (commitMessage !== plugin.settings.commitMessage) { $$invalidate(2, commitMessage = ""); } @@ -42640,7 +43509,7 @@ function instance9($$self, $$props, $$invalidate) { const unPushedCommits = yield plugin.gitManager.getUnpushedCommits(); buttons.forEach((btn) => { var _a2, _b; - if (import_obsidian28.Platform.isMobile) { + if (import_obsidian29.Platform.isMobile) { btn.removeClass("button-border"); if (btn.id == "push" && unPushedCommits > 0) { btn.addClass("button-border"); @@ -42711,7 +43580,7 @@ function instance9($$self, $$props, $$invalidate) { plugin.promiseQueue.addTask(() => plugin.pullChangesFromRemote().finally(triggerRefresh2)); } function discard() { - new DiscardModal(view.app, false, plugin.gitManager.getVaultPath("/")).myOpen().then((shouldDiscard) => { + new DiscardModal(view.app, false, plugin.gitManager.getRelativeVaultPath("/")).myOpen().then((shouldDiscard) => { if (shouldDiscard === true) { plugin.promiseQueue.addTask(() => plugin.gitManager.discardAll({ status: plugin.cachedStatus }).finally(() => { dispatchEvent(new CustomEvent("git-refresh")); @@ -42804,7 +43673,7 @@ function instance9($$self, $$props, $$invalidate) { $: { if (layoutBtn) { layoutBtn.empty(); - (0, import_obsidian28.setIcon)(layoutBtn, showTree ? "list" : "folder"); + (0, import_obsidian29.setIcon)(layoutBtn, showTree ? "list" : "folder"); } } } @@ -42859,13 +43728,13 @@ function instance9($$self, $$props, $$invalidate) { var SourceControl = class extends SvelteComponent { constructor(options) { super(); - init2(this, options, instance9, create_fragment9, safe_not_equal, { plugin: 0, view: 1 }, add_css8, [-1, -1]); + init2(this, options, instance9, create_fragment9, safe_not_equal, { plugin: 0, view: 1 }, add_css7, [-1, -1]); } }; var sourceControl_default = SourceControl; // src/ui/sourceControl/sourceControl.ts -var GitView = class extends import_obsidian29.ItemView { +var GitView = class extends import_obsidian30.ItemView { constructor(leaf, plugin) { super(leaf); this.plugin = plugin; @@ -42921,7 +43790,7 @@ var BranchStatusBar = class { }; // src/main.ts -var ObsidianGit = class extends import_obsidian30.Plugin { +var ObsidianGit = class extends import_obsidian31.Plugin { constructor() { super(...arguments); this.gitReady = false; @@ -42996,7 +43865,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin { id: "edit-gitignore", name: "Edit .gitignore", callback: async () => { - const path2 = this.gitManager.getVaultPath(".gitignore"); + const path2 = this.gitManager.getRelativeVaultPath(".gitignore"); if (!await this.app.vault.adapter.exists(path2)) { this.app.vault.adapter.write(path2, ""); } @@ -43063,7 +43932,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin { active: true, state: { staged: false, - file: this.gitManager.asRepositoryRelativePath( + file: this.gitManager.getRelativeRepoPath( file.path, true ) @@ -43107,13 +43976,13 @@ var ObsidianGit = class extends import_obsidian30.Plugin { id: "add-to-gitignore", name: "Add file to gitignore", checkCallback: (checking) => { - const file = app.workspace.getActiveFile(); + const file = this.app.workspace.getActiveFile(); if (checking) { return file !== null; } else { - app.vault.adapter.append( - this.gitManager.getVaultPath(".gitignore"), - "\n" + this.gitManager.asRepositoryRelativePath( + this.app.vault.adapter.append( + this.gitManager.getRelativeVaultPath(".gitignore"), + "\n" + this.gitManager.getRelativeRepoPath( file.path, true ) @@ -43169,6 +44038,20 @@ var ObsidianGit = class extends import_obsidian30.Plugin { }) ) }); + if (import_obsidian31.Platform.isDesktopApp) { + this.addCommand({ + id: "commit-amend-staged-specified-message", + name: "Commit Amend", + callback: () => this.promiseQueue.addTask( + () => this.commit({ + fromAutoBackup: false, + requestCustomMessage: true, + onlyStaged: true, + amend: true + }) + ) + }); + } this.addCommand({ id: "commit-staged-specified-message", name: "Commit staged with specific message", @@ -43219,6 +44102,11 @@ var ObsidianGit = class extends import_obsidian30.Plugin { name: "Remove remote", callback: async () => this.removeRemote() }); + this.addCommand({ + id: "set-upstream-branch", + name: "Set upstream branch", + callback: async () => this.setUpsreamBranch() + }); this.addCommand({ id: "delete-repo", name: "CAUTION: Delete repository", @@ -43238,14 +44126,14 @@ var ObsidianGit = class extends import_obsidian30.Plugin { `${this.settings.basePath}/.git`, true ); - new import_obsidian30.Notice( + new import_obsidian31.Notice( "Successfully deleted repository. Reloading plugin..." ); this.unloadPlugin(); this.init(); } } else { - new import_obsidian30.Notice("No repository found"); + new import_obsidian31.Notice("No repository found"); } } }); @@ -43266,12 +44154,13 @@ var ObsidianGit = class extends import_obsidian30.Plugin { if (!await this.isAllInitialized()) return; const status2 = await this.gitManager.status(); + console.log(status2); this.setState(0 /* idle */); if (status2.changed.length + status2.staged.length > 500) { this.displayError("Too many changes to display"); return; } - new ChangedFilesModal(this, status2.changed).open(); + new ChangedFilesModal(this, status2.all).open(); } }); this.addCommand({ @@ -43337,7 +44226,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin { }, 1e3) ); } - if (import_obsidian30.Platform.isDesktop && this.settings.showBranchStatusBar) { + if (import_obsidian31.Platform.isDesktop && this.settings.showBranchStatusBar) { const branchStatusBarEl = this.addStatusBarItem(); this.branchBar = new BranchStatusBar(branchStatusBarEl, this); this.registerInterval( @@ -43352,7 +44241,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin { setRefreshDebouncer() { var _a2; (_a2 = this.debRefresh) == null ? void 0 : _a2.cancel(); - this.debRefresh = (0, import_obsidian30.debounce)( + this.debRefresh = (0, import_obsidian31.debounce)( () => { if (this.settings.refreshSourceControl) { this.refresh(); @@ -43364,17 +44253,17 @@ var ObsidianGit = class extends import_obsidian30.Plugin { } async showNotices() { const length = 1e4; - if (this.manifest.id === "obsidian-git" && import_obsidian30.Platform.isDesktopApp && !this.settings.showedMobileNotice) { - new import_obsidian30.Notice( - "Obsidian Git is now available on mobile! Please read the plugin's README for more information.", + if (this.manifest.id === "obsidian-git" && import_obsidian31.Platform.isDesktopApp && !this.settings.showedMobileNotice) { + new import_obsidian31.Notice( + "Git is now available on mobile! Please read the plugin's README for more information.", length ); this.settings.showedMobileNotice = true; await this.saveSettings(); } if (this.manifest.id === "obsidian-git-isomorphic") { - new import_obsidian30.Notice( - "Obsidian Git Mobile is now deprecated. Please uninstall it and install Obsidian Git instead.", + new import_obsidian31.Notice( + "Git Mobile is now deprecated. Please uninstall it and install Git instead.", length ); } @@ -43393,11 +44282,11 @@ var ObsidianGit = class extends import_obsidian30.Plugin { menu.addItem((item) => { item.setTitle(`Git: Stage`).setIcon("plus-circle").setSection("action").onClick((_) => { this.promiseQueue.addTask(async () => { - if (file instanceof import_obsidian30.TFile) { + if (file instanceof import_obsidian31.TFile) { await this.gitManager.stage(file.path, true); } else { await this.gitManager.stageAll({ - dir: this.gitManager.asRepositoryRelativePath( + dir: this.gitManager.getRelativeRepoPath( file.path, true ) @@ -43410,11 +44299,11 @@ var ObsidianGit = class extends import_obsidian30.Plugin { menu.addItem((item) => { item.setTitle(`Git: Unstage`).setIcon("minus-circle").setSection("action").onClick((_) => { this.promiseQueue.addTask(async () => { - if (file instanceof import_obsidian30.TFile) { + if (file instanceof import_obsidian31.TFile) { await this.gitManager.unstage(file.path, true); } else { await this.gitManager.unstageAll({ - dir: this.gitManager.asRepositoryRelativePath( + dir: this.gitManager.getRelativeRepoPath( file.path, true ) @@ -43502,7 +44391,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin { }; } get useSimpleGit() { - return import_obsidian30.Platform.isDesktopApp; + return import_obsidian31.Platform.isDesktopApp; } async init() { var _a2; @@ -43520,7 +44409,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin { this.displayError("Cannot run git command"); break; case "missing-repo": - new import_obsidian30.Notice( + new import_obsidian31.Notice( "Can't find a valid git repository. Please create one via the given command or clone an existing repo.", 1e4 ); @@ -43570,7 +44459,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin { } async createNewRepo() { await this.gitManager.init(); - new import_obsidian30.Notice("Initialized new repo"); + new import_obsidian31.Notice("Initialized new repo"); await this.init(); } async cloneNewRepo() { @@ -43587,7 +44476,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin { if (dir === confirmOption) { dir = "."; } - dir = (0, import_obsidian30.normalizePath)(dir); + dir = (0, import_obsidian31.normalizePath)(dir); if (dir === "/") { dir = "."; } @@ -43599,7 +44488,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin { }); const containsConflictDir = await modal2.open(); if (containsConflictDir === void 0) { - new import_obsidian30.Notice("Aborted clone"); + new import_obsidian31.Notice("Aborted clone"); return; } else if (containsConflictDir === "YES") { const confirmOption2 = "DELETE ALL YOUR LOCAL CONFIG AND PLUGINS"; @@ -43615,7 +44504,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin { true ); } else { - new import_obsidian30.Notice("Aborted clone"); + new import_obsidian31.Notice("Aborted clone"); return; } } @@ -43628,11 +44517,11 @@ var ObsidianGit = class extends import_obsidian30.Plugin { if (depth !== "") { depthInt = parseInt(depth); if (isNaN(depthInt)) { - new import_obsidian30.Notice("Invalid depth. Aborting clone."); + new import_obsidian31.Notice("Invalid depth. Aborting clone."); return; } } - new import_obsidian30.Notice(`Cloning new repo into "${dir}"`); + new import_obsidian31.Notice(`Cloning new repo into "${dir}"`); const oldBase = this.settings.basePath; const customDir = dir && dir !== "."; if (customDir) { @@ -43645,8 +44534,8 @@ var ObsidianGit = class extends import_obsidian30.Plugin { this.saveSettings(); throw error; } - new import_obsidian30.Notice("Cloned new repo."); - new import_obsidian30.Notice("Please restart Obsidian"); + new import_obsidian31.Notice("Cloned new repo."); + new import_obsidian31.Notice("Please restart Obsidian"); if (customDir) { this.saveSettings(); } @@ -43669,6 +44558,9 @@ var ObsidianGit = class extends import_obsidian30.Plugin { return; const filesUpdated = await this.pull(); this.setUpAutoBackup(); + if (filesUpdated === false) { + return; + } if (!filesUpdated) { this.displayMessage("Everything is up-to-date"); } @@ -43713,7 +44605,8 @@ var ObsidianGit = class extends import_obsidian30.Plugin { fromAutoBackup, requestCustomMessage = false, onlyStaged = false, - commitMessage + commitMessage, + amend = false }) { if (!await this.isAllInitialized()) return false; @@ -43752,7 +44645,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin { } else { unstagedFiles = await this.gitManager.getUnstagedFiles(); changedFiles = unstagedFiles.map(({ filepath }) => ({ - vault_path: this.gitManager.getVaultPath(filepath) + vault_path: this.gitManager.getRelativeVaultPath(filepath) })); } } @@ -43764,7 +44657,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin { let cmtMessage = commitMessage != null ? commitMessage : commitMessage = fromAutoBackup ? this.settings.autoCommitMessage : this.settings.commitMessage; if (fromAutoBackup && this.settings.customMessageOnAutoBackup || requestCustomMessage) { if (!this.settings.disablePopups && fromAutoBackup) { - new import_obsidian30.Notice( + new import_obsidian31.Notice( "Auto backup: Please enter a custom commit message. Leave empty to abort" ); } @@ -43781,12 +44674,16 @@ var ObsidianGit = class extends import_obsidian30.Plugin { } let committedFiles; if (onlyStaged) { - committedFiles = await this.gitManager.commit(cmtMessage); + committedFiles = await this.gitManager.commit({ + message: cmtMessage, + amend + }); } else { committedFiles = await this.gitManager.commitAll({ message: cmtMessage, status: status2, - unstagedFiles + unstagedFiles, + amend }); } if (this.gitManager instanceof SimpleGit) { @@ -43820,7 +44717,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin { const file = this.app.vault.getAbstractFileByPath( f.vault_path ); - if (file instanceof import_obsidian30.TFile) { + if (file instanceof import_obsidian31.TFile) { return file.stat.size >= 1e8; } return false; @@ -43858,9 +44755,9 @@ var ObsidianGit = class extends import_obsidian30.Plugin { this.setState(6 /* conflicted */); return false; } - { - console.log("Pushing...."); - const pushedFiles = await this.gitManager.push(); + console.log("Pushing...."); + const pushedFiles = await this.gitManager.push(); + if (pushedFiles !== void 0) { console.log("Pushed!", pushedFiles); if (pushedFiles > 0) { this.displayMessage( @@ -43869,14 +44766,17 @@ var ObsidianGit = class extends import_obsidian30.Plugin { } else { this.displayMessage(`No changes to push`); } - this.offlineMode = false; - this.setState(0 /* idle */); - dispatchEvent(new CustomEvent("git-refresh")); - return true; } + this.offlineMode = false; + this.setState(0 /* idle */); + dispatchEvent(new CustomEvent("git-refresh")); + return true; } - /// Used for internals - /// Returns whether the pull added a commit or not. + // + // Used for internals + // Returns whether the pull added a commit or not. + // + // See {@link pullChangesFromRemote} for the command version. async pull() { if (!await this.remotesAreSet()) { return false; @@ -43889,7 +44789,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin { ); this.lastPulledFiles = pulledFiles; } - return pulledFiles.length != 0; + return pulledFiles.length; } async fetch() { if (!await this.remotesAreSet()) { @@ -43907,7 +44807,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin { if (file) { this.app.workspace.iterateAllLeaves((leaf) => { var _a2; - if (leaf.view instanceof import_obsidian30.MarkdownView && ((_a2 = leaf.view.file) == null ? void 0 : _a2.path) == file.path) { + if (leaf.view instanceof import_obsidian31.MarkdownView && ((_a2 = leaf.view.file) == null ? void 0 : _a2.path) == file.path) { leaf.detach(); } }); @@ -44006,21 +44906,35 @@ var ObsidianGit = class extends import_obsidian30.Plugin { return branch2; } } + // Ensures that the upstream branch is set. + // If not, it will prompt the user to set it. + // + // An exception is when the user has submodules enabled. + // In this case, the upstream branch is not required, + // to allow pulling/pushing only the submodules and not the outer repo. async remotesAreSet() { + if (this.settings.updateSubmodules) { + return true; + } if (!(await this.gitManager.branchInfo()).tracking) { - new import_obsidian30.Notice("No upstream branch is set. Please select one."); - const remoteBranch = await this.selectRemoteBranch(); - if (remoteBranch == void 0) { - this.displayError("Aborted. No upstream-branch is set!", 1e4); - this.setState(0 /* idle */); - return false; - } else { - await this.gitManager.updateUpstreamBranch(remoteBranch); - return true; - } + new import_obsidian31.Notice("No upstream branch is set. Please select one."); + return await this.setUpsreamBranch(); } return true; } + async setUpsreamBranch() { + const remoteBranch = await this.selectRemoteBranch(); + if (remoteBranch == void 0) { + this.displayError("Aborted. No upstream-branch is set!", 1e4); + this.setState(0 /* idle */); + return false; + } else { + await this.gitManager.updateUpstreamBranch(remoteBranch); + this.displayMessage(`Set upstream branch to ${remoteBranch}`); + this.setState(0 /* idle */); + return true; + } + } async setUpAutoBackup() { if (this.settings.setLastSaveToLastCommit) { this.clearAutoBackup(); @@ -44033,10 +44947,10 @@ var ObsidianGit = class extends import_obsidian30.Plugin { const lastAutos = this.loadLastAuto(); if (this.settings.autoSaveInterval > 0) { const now2 = /* @__PURE__ */ new Date(); - const diff2 = this.settings.autoSaveInterval - Math.round( + const diff3 = this.settings.autoSaveInterval - Math.round( (now2.getTime() - lastAutos.backup.getTime()) / 1e3 / 60 ); - this.startAutoBackup(diff2 <= 0 ? 0 : diff2); + this.startAutoBackup(diff3 <= 0 ? 0 : diff3); } } } @@ -44045,24 +44959,24 @@ var ObsidianGit = class extends import_obsidian30.Plugin { const lastAutos = this.loadLastAuto(); if (this.settings.differentIntervalCommitAndPush && this.settings.autoPushInterval > 0) { const now2 = /* @__PURE__ */ new Date(); - const diff2 = this.settings.autoPushInterval - Math.round( + const diff3 = this.settings.autoPushInterval - Math.round( (now2.getTime() - lastAutos.push.getTime()) / 1e3 / 60 ); - this.startAutoPush(diff2 <= 0 ? 0 : diff2); + this.startAutoPush(diff3 <= 0 ? 0 : diff3); } if (this.settings.autoPullInterval > 0) { const now2 = /* @__PURE__ */ new Date(); - const diff2 = this.settings.autoPullInterval - Math.round( + const diff3 = this.settings.autoPullInterval - Math.round( (now2.getTime() - lastAutos.pull.getTime()) / 1e3 / 60 ); - this.startAutoPull(diff2 <= 0 ? 0 : diff2); + this.startAutoPull(diff3 <= 0 ? 0 : diff3); } } async discardAll() { await this.gitManager.discardAll({ status: this.cachedStatus }); - new import_obsidian30.Notice( + new import_obsidian31.Notice( "All local changes have been discarded. New files remain untouched." ); } @@ -44081,7 +44995,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin { "modify", () => this.autoBackupDebouncer() ); - this.autoBackupDebouncer = (0, import_obsidian30.debounce)( + this.autoBackupDebouncer = (0, import_obsidian31.debounce)( () => this.doAutoBackup(), time, true @@ -44170,13 +45084,13 @@ var ObsidianGit = class extends import_obsidian30.Plugin { if (conflicted !== void 0) { lines = [ "# Conflicts", - "Please resolve them and commit them using the commands `Obsidian Git: Commit all changes` followed by `Obsidian Git: Push`", + "Please resolve them and commit them using the commands `Git: Commit all changes` followed by `Git: Push`", "(This file will automatically be deleted before commit)", "[[#Additional Instructions]] available below file list", "", ...conflicted.map((e) => { const file = this.app.vault.getAbstractFileByPath(e); - if (file instanceof import_obsidian30.TFile) { + if (file instanceof import_obsidian31.TFile) { const link = this.app.metadataCache.fileToLinktext( file, "/" @@ -44237,9 +45151,7 @@ I strongly recommend to use "Source mode" for viewing the conflicted files. For if (remoteName) { this.displayMessage("Fetching remote branches"); await this.gitManager.fetch(remoteName); - const branches = await this.gitManager.getRemoteBranches( - remoteName - ); + const branches = await this.gitManager.getRemoteBranches(remoteName); const branchModal = new GeneralModal({ options: branches, placeholder: "Select or create a new remote branch by typing its name and selecting it" @@ -44309,21 +45221,26 @@ I strongly recommend to use "Source mode" for viewing the conflicted files. For var _a2; (_a2 = this.statusBar) == null ? void 0 : _a2.displayMessage(message.toLowerCase(), timeout); if (!this.settings.disablePopups) { - new import_obsidian30.Notice(message, 5 * 1e3); + if (!this.settings.disablePopupsForNoChanges || !message.startsWith("No changes")) { + new import_obsidian31.Notice(message, 5 * 1e3); + } } - console.log(`git obsidian message: ${message}`); + this.log(message); } displayError(message, timeout = 10 * 1e3) { var _a2; if (message instanceof Errors.UserCanceledError) { - new import_obsidian30.Notice("Aborted"); + new import_obsidian31.Notice("Aborted"); return; } message = message.toString(); - new import_obsidian30.Notice(message, timeout); + new import_obsidian31.Notice(message, timeout); console.log(`git obsidian error: ${message}`); (_a2 = this.statusBar) == null ? void 0 : _a2.displayMessage(message.toLowerCase(), timeout); } + log(message) { + console.log(`${this.manifest.id}: ` + message); + } }; /*! Bundled license information: diff --git a/.obsidian/plugins/obsidian-git/manifest.json b/.obsidian/plugins/obsidian-git/manifest.json index 31fee23..1e5a17a 100644 --- a/.obsidian/plugins/obsidian-git/manifest.json +++ b/.obsidian/plugins/obsidian-git/manifest.json @@ -1,9 +1,9 @@ { "id": "obsidian-git", - "name": "Obsidian Git", + "name": "Git", "description": "Backup your vault with Git.", "isDesktopOnly": false, "fundingUrl": "https://ko-fi.com/vinzent", "js": "main.js", - "version": "2.22.1" + "version": "2.24.0" } diff --git a/.obsidian/plugins/obsidian-git/styles.css b/.obsidian/plugins/obsidian-git/styles.css index c1d5065..226dbe9 100644 --- a/.obsidian/plugins/obsidian-git/styles.css +++ b/.obsidian/plugins/obsidian-git/styles.css @@ -8,20 +8,20 @@ } } -.workspace-leaf-content[data-type='git-view'] .button-border { +.workspace-leaf-content[data-type="git-view"] .button-border { border: 2px solid var(--interactive-accent); border-radius: var(--radius-s); } -.workspace-leaf-content[data-type='git-view'] .view-content { +.workspace-leaf-content[data-type="git-view"] .view-content { padding: 0; } -.workspace-leaf-content[data-type='git-history-view'] .view-content { +.workspace-leaf-content[data-type="git-history-view"] .view-content { padding: 0; } -.loading>svg { +.loading > svg { animation: 2s linear infinite loading; transform-origin: 50% 50%; display: inline-block; @@ -77,6 +77,18 @@ height: auto; } +.git-author { + color: var(--text-accent); +} + +.git-date { + color: var(--text-accent); +} + +.git-ref { + color: var(--text-accent); +} + .workspace-leaf-content[data-type="diff-view"] .d2h-d-none { display: none; } @@ -228,12 +240,18 @@ } .theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del, -.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line del { +.theme-light + .workspace-leaf-content[data-type="diff-view"] + .d2h-code-side-line + del { background-color: #ffb6ba; } .theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del, -.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line del { +.theme-dark + .workspace-leaf-content[data-type="diff-view"] + .d2h-code-side-line + del { background-color: #8d232881; } @@ -249,13 +267,19 @@ } .theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins, -.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line ins { +.theme-light + .workspace-leaf-content[data-type="diff-view"] + .d2h-code-side-line + ins { background-color: #97f295; text-align: left; } .theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins, -.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line ins { +.theme-dark + .workspace-leaf-content[data-type="diff-view"] + .d2h-code-side-line + ins { background-color: #1d921996; text-align: left; } @@ -376,19 +400,31 @@ color: var(--text-normal); } -.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-del.d2h-change { +.theme-light + .workspace-leaf-content[data-type="diff-view"] + .d2h-file-diff + .d2h-del.d2h-change { background-color: #fdf2d0; } -.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-del.d2h-change { +.theme-dark + .workspace-leaf-content[data-type="diff-view"] + .d2h-file-diff + .d2h-del.d2h-change { background-color: #55492480; } -.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-ins.d2h-change { +.theme-light + .workspace-leaf-content[data-type="diff-view"] + .d2h-file-diff + .d2h-ins.d2h-change { background-color: #ded; } -.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-ins.d2h-change { +.theme-dark + .workspace-leaf-content[data-type="diff-view"] + .d2h-file-diff + .d2h-ins.d2h-change { background-color: rgba(37, 78, 37, 0.418); } @@ -401,7 +437,9 @@ text-decoration: none; } -.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-wrapper a:visited { +.workspace-leaf-content[data-type="diff-view"] + .d2h-file-list-wrapper + a:visited { color: #3572b0; } @@ -427,13 +465,13 @@ padding: 0; } -.workspace-leaf-content[data-type="diff-view"] .d2h-file-list>li { +.workspace-leaf-content[data-type="diff-view"] .d2h-file-list > li { border-bottom: 1px solid var(--background-modifier-border); margin: 0; padding: 5px 10px; } -.workspace-leaf-content[data-type="diff-view"] .d2h-file-list>li:last-child { +.workspace-leaf-content[data-type="diff-view"] .d2h-file-list > li:last-child { border-bottom: none; } @@ -501,9 +539,10 @@ background-color: var(--background-secondary); } -.cm-gutterElement.obs-git-blame-gutter > div, .line-author-settings-preview { +.cm-gutterElement.obs-git-blame-gutter > div, +.line-author-settings-preview { /* delegate text color to settings */ - color: var(--obs-git-gutter-text); + color: var(--obs-git-gutter-text); font-family: monospace; height: 100%; /* ensure, that age-based background color occupies entire parent */ text-align: right; diff --git a/.obsidian/plugins/templater-obsidian/main.js b/.obsidian/plugins/templater-obsidian/main.js index 2a5d1ff..b99ae3b 100644 --- a/.obsidian/plugins/templater-obsidian/main.js +++ b/.obsidian/plugins/templater-obsidian/main.js @@ -1743,6 +1743,12 @@ function arraymove(arr, fromIndex, toIndex) { function get_active_file(app2) { return app2.workspace.activeEditor?.file ?? app2.workspace.getActiveFile(); } +function get_folder_path_from_file_path(path) { + const path_separator = path.lastIndexOf("/"); + if (path_separator !== -1) + return path.slice(0, path_separator); + return ""; +} // src/settings/suggesters/FileSuggester.ts var FileSuggestMode; @@ -2663,7 +2669,10 @@ var InternalModuleHooks = class extends InternalModule { } generate_on_all_templates_executed() { return (callback_function) => { - const event_ref = app.workspace.on("templater:all-templates-executed", () => callback_function()); + const event_ref = app.workspace.on("templater:all-templates-executed", async () => { + await delay(1); + callback_function(); + }); if (event_ref) { this.event_refs.push(event_ref); } @@ -2704,7 +2713,7 @@ var PromptModal = class extends import_obsidian9.Modal { onClose() { this.contentEl.empty(); if (!this.submitted) { - this.reject(); + this.reject(new TemplaterError("Cancelled prompt")); } } createForm() { @@ -2734,15 +2743,8 @@ var PromptModal = class extends import_obsidian9.Modal { if (evt.isComposing || evt.keyCode === 229) return; if (this.multi_line) { - if (import_obsidian9.Platform.isDesktop) { - if (evt.shiftKey && evt.key === "Enter") { - } else if (evt.key === "Enter") { - this.resolveAndClose(evt); - } - } else { - if (evt.key === "Enter") { - evt.preventDefault(); - } + if (import_obsidian9.Platform.isDesktop && evt.key === "Enter" && !evt.shiftKey) { + this.resolveAndClose(evt); } } else { if (evt.key === "Enter") { @@ -2988,8 +2990,8 @@ var UserScriptFunctions = class { exports: exp }; const file_content = await app.vault.read(file); - const wrapping_fn = window.eval("(function anonymous(require, module, exports){" + file_content + "\n})"); try { + const wrapping_fn = window.eval("(function anonymous(require, module, exports){" + file_content + "\n})"); wrapping_fn(req, mod, exp); } catch (err) { throw new TemplaterError(`Failed to load user script at "${file.path}".`, err.message); @@ -3587,7 +3589,15 @@ var Templater = class { break; } } - const created_note = await errorWrapper(async () => app.fileManager.createNewMarkdownFile(folder, filename ?? "Untitled"), "Couldn't create markdown file."); + const extension = template instanceof import_obsidian12.TFile ? template.extension || "md" : "md"; + const created_note = await errorWrapper(async () => { + const path = app.vault.getAvailablePath((0, import_obsidian12.normalizePath)(`${folder?.path ?? ""}/${filename || "Untitled"}`), extension); + const folder_path = get_folder_path_from_file_path(path); + if (folder_path && !app.vault.getAbstractFileByPathInsensitive(folder_path)) { + await app.vault.createFolder(folder_path); + } + return app.vault.create(path, ""); + }, `Couldn't create ${extension} file.`); if (created_note == null) { await this.end_templater_task(); return; @@ -3667,7 +3677,7 @@ var Templater = class { return; } await app.vault.modify(file, output_content); - if (active_file?.path !== file.path && active_editor && active_editor.editor) { + if (active_file?.path === file.path && active_editor && active_editor.editor) { const editor = active_editor.editor; editor.setSelection({ line: 0, ch: 0 }, { line: 0, ch: 0 }); } diff --git a/.obsidian/plugins/templater-obsidian/manifest.json b/.obsidian/plugins/templater-obsidian/manifest.json index fd8f2b5..7380193 100644 --- a/.obsidian/plugins/templater-obsidian/manifest.json +++ b/.obsidian/plugins/templater-obsidian/manifest.json @@ -1,7 +1,7 @@ { "id": "templater-obsidian", "name": "Templater", - "version": "2.1.1", + "version": "2.2.3", "description": "Create and use templates", "minAppVersion": "1.5.0", "author": "SilentVoid", diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index f4963d2..4c345b7 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -4,11 +4,11 @@ "type": "split", "children": [ { - "id": "47897c4d1315cd5a", + "id": "d44494af75811809", "type": "tabs", "children": [ { - "id": "7af4969d59fe9883", + "id": "71e7b4a13fe35619", "type": "leaf", "state": { "type": "empty", @@ -128,8 +128,10 @@ "templater-obsidian:Templater": false } }, - "active": "7af4969d59fe9883", + "active": "71e7b4a13fe35619", "lastOpenFiles": [ + "KB/Linux/Desktop/GPG - PGP.md", + "KB/Linux/Server/Hetzner/Storagebox.md", "KB/Linux/Desktop/ArchLinux/Theming Qt and Gtk.md", "KB/Linux/Desktop/ArchLinux/sway.md", "KB/Linux/Desktop/ArchLinux/i3.md", @@ -140,7 +142,6 @@ "KB/Linux/Desktop/ArchLinux/Tweaks.md", "KB/Linux/Desktop/ArchLinux/Audio/aptx and pulseaudio.md", "KB/Linux/Server/systemd.md", - "KB/Linux/Desktop/GPG - PGP.md", "KB/Linux/Desktop/ArchLinux/Fonts.md", "KB/Linux/Desktop/ArchLinux/Firewall.md", "KB/Linux/Desktop/ArchLinux/Install.md", @@ -150,7 +151,6 @@ "KB/Linux/Server/Docker Volume Migration.md", "KB/Linux/Server/DNS.md", "KB/Linux/Server/Client certificate generation.md", - "KB/Linux/Server/Hetzner/Storagebox.md", "KB/Linux/Server/ArchLinux/Remote unlocking at boot.md", "KB/Linux/Server/ArchLinux/Security hardening.md", "KB/Linux/Server/ArchLinux/Bootstrap.md",