UNPKG

@tomplum/react-git-log

Version:

A flexible, themable, React component for visualising Git commit history, branch and tag metadata.

1,270 lines (1,268 loc) 149 kB
import './index.css';var Cr = Object.defineProperty; var $r = (e, r, t) => r in e ? Cr(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t; var Fe = (e, r, t) => $r(e, typeof r != "symbol" ? r + "" : r, t); import * as Q from "react"; import ye, { createContext as nt, useContext as it, useMemo as q, useCallback as ie, useState as Ce, useRef as Nr, useEffect as pt, Children as Er, isValidElement as Rr } from "react"; import Tr from "react-dom"; function Se(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } var Xe = { exports: {} }, Ve = {}; /** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Rt; function Mr() { if (Rt) return Ve; Rt = 1; var e = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment"); function t(o, u, a) { var d = null; if (a !== void 0 && (d = "" + a), u.key !== void 0 && (d = "" + u.key), "key" in u) { a = {}; for (var l in u) l !== "key" && (a[l] = u[l]); } else a = u; return u = a.ref, { $$typeof: e, type: o, key: d, ref: u !== void 0 ? u : null, props: a }; } return Ve.Fragment = r, Ve.jsx = t, Ve.jsxs = t, Ve; } var He = {}; /** * @license React * react-jsx-runtime.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Tt; function Sr() { return Tt || (Tt = 1, process.env.NODE_ENV !== "production" && function() { function e(c) { if (c == null) return null; if (typeof c == "function") return c.$$typeof === $ ? null : c.displayName || c.name || null; if (typeof c == "string") return c; switch (c) { case N: return "Fragment"; case C: return "Portal"; case L: return "Profiler"; case S: return "StrictMode"; case X: return "Suspense"; case G: return "SuspenseList"; } if (typeof c == "object") switch (typeof c.tag == "number" && console.error( "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." ), c.$$typeof) { case k: return (c.displayName || "Context") + ".Provider"; case z: return (c._context.displayName || "Context") + ".Consumer"; case T: var x = c.render; return c = c.displayName, c || (c = x.displayName || x.name || "", c = c !== "" ? "ForwardRef(" + c + ")" : "ForwardRef"), c; case M: return x = c.displayName || null, x !== null ? x : e(c.type) || "Memo"; case y: x = c._payload, c = c._init; try { return e(c(x)); } catch { } } return null; } function r(c) { return "" + c; } function t(c) { try { r(c); var x = !1; } catch { x = !0; } if (x) { x = console; var E = x.error, A = typeof Symbol == "function" && Symbol.toStringTag && c[Symbol.toStringTag] || c.constructor.name || "Object"; return E.call( x, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", A ), r(c); } } function o() { } function u() { if (B === 0) { U = console.log, Z = console.info, ne = console.warn, ee = console.error, oe = console.group, J = console.groupCollapsed, re = console.groupEnd; var c = { configurable: !0, enumerable: !0, value: o, writable: !0 }; Object.defineProperties(console, { info: c, log: c, warn: c, error: c, group: c, groupCollapsed: c, groupEnd: c }); } B++; } function a() { if (B--, B === 0) { var c = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: Y({}, c, { value: U }), info: Y({}, c, { value: Z }), warn: Y({}, c, { value: ne }), error: Y({}, c, { value: ee }), group: Y({}, c, { value: oe }), groupCollapsed: Y({}, c, { value: J }), groupEnd: Y({}, c, { value: re }) }); } 0 > B && console.error( "disabledDepth fell below zero. This is a bug in React. Please file an issue." ); } function d(c) { if (fe === void 0) try { throw Error(); } catch (E) { var x = E.stack.trim().match(/\n( *(at )?)/); fe = x && x[1] || "", ce = -1 < E.stack.indexOf(` at`) ? " (<anonymous>)" : -1 < E.stack.indexOf("@") ? "@unknown:0:0" : ""; } return ` ` + fe + c + ce; } function l(c, x) { if (!c || pe) return ""; var E = se.get(c); if (E !== void 0) return E; pe = !0, E = Error.prepareStackTrace, Error.prepareStackTrace = void 0; var A = null; A = D.H, D.H = null, u(); try { var K = { DetermineComponentFrameRoot: function() { try { if (x) { var _e = function() { throw Error(); }; if (Object.defineProperty(_e.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(_e, []); } catch (we) { var Ue = we; } Reflect.construct(c, [], _e); } else { try { _e.call(); } catch (we) { Ue = we; } c.call(_e.prototype); } } else { try { throw Error(); } catch (we) { Ue = we; } (_e = c()) && typeof _e.catch == "function" && _e.catch(function() { }); } } catch (we) { if (we && Ue && typeof we.stack == "string") return [we.stack, Ue.stack]; } return [null, null]; } }; K.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot"; var F = Object.getOwnPropertyDescriptor( K.DetermineComponentFrameRoot, "name" ); F && F.configurable && Object.defineProperty( K.DetermineComponentFrameRoot, "name", { value: "DetermineComponentFrameRoot" } ); var I = K.DetermineComponentFrameRoot(), be = I[0], Le = I[1]; if (be && Le) { var le = be.split(` `), Re = Le.split(` `); for (I = F = 0; F < le.length && !le[F].includes( "DetermineComponentFrameRoot" ); ) F++; for (; I < Re.length && !Re[I].includes( "DetermineComponentFrameRoot" ); ) I++; if (F === le.length || I === Re.length) for (F = le.length - 1, I = Re.length - 1; 1 <= F && 0 <= I && le[F] !== Re[I]; ) I--; for (; 1 <= F && 0 <= I; F--, I--) if (le[F] !== Re[I]) { if (F !== 1 || I !== 1) do if (F--, I--, 0 > I || le[F] !== Re[I]) { var ze = ` ` + le[F].replace( " at new ", " at " ); return c.displayName && ze.includes("<anonymous>") && (ze = ze.replace("<anonymous>", c.displayName)), typeof c == "function" && se.set(c, ze), ze; } while (1 <= F && 0 <= I); break; } } } finally { pe = !1, D.H = A, a(), Error.prepareStackTrace = E; } return le = (le = c ? c.displayName || c.name : "") ? d(le) : "", typeof c == "function" && se.set(c, le), le; } function h(c) { if (c == null) return ""; if (typeof c == "function") { var x = c.prototype; return l( c, !(!x || !x.isReactComponent) ); } if (typeof c == "string") return d(c); switch (c) { case X: return d("Suspense"); case G: return d("SuspenseList"); } if (typeof c == "object") switch (c.$$typeof) { case T: return c = l(c.render, !1), c; case M: return h(c.type); case y: x = c._payload, c = c._init; try { return h(c(x)); } catch { } } return ""; } function s() { var c = D.A; return c === null ? null : c.getOwner(); } function n(c) { if (O.call(c, "key")) { var x = Object.getOwnPropertyDescriptor(c, "key").get; if (x && x.isReactWarning) return !1; } return c.key !== void 0; } function i(c, x) { function E() { ve || (ve = !0, console.error( "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", x )); } E.isReactWarning = !0, Object.defineProperty(c, "key", { get: E, configurable: !0 }); } function f() { var c = e(this.type); return me[c] || (me[c] = !0, console.error( "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." )), c = this.props.ref, c !== void 0 ? c : null; } function p(c, x, E, A, K, F) { return E = F.ref, c = { $$typeof: R, type: c, key: x, props: F, _owner: K }, (E !== void 0 ? E : null) !== null ? Object.defineProperty(c, "ref", { enumerable: !1, get: f }) : Object.defineProperty(c, "ref", { enumerable: !1, value: null }), c._store = {}, Object.defineProperty(c._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: 0 }), Object.defineProperty(c, "_debugInfo", { configurable: !1, enumerable: !1, writable: !0, value: null }), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c; } function m(c, x, E, A, K, F) { if (typeof c == "string" || typeof c == "function" || c === N || c === L || c === S || c === X || c === G || c === b || typeof c == "object" && c !== null && (c.$$typeof === y || c.$$typeof === M || c.$$typeof === k || c.$$typeof === z || c.$$typeof === T || c.$$typeof === V || c.getModuleId !== void 0)) { var I = x.children; if (I !== void 0) if (A) if (W(I)) { for (A = 0; A < I.length; A++) v(I[A], c); Object.freeze && Object.freeze(I); } else console.error( "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." ); else v(I, c); } else I = "", (c === void 0 || typeof c == "object" && c !== null && Object.keys(c).length === 0) && (I += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), c === null ? A = "null" : W(c) ? A = "array" : c !== void 0 && c.$$typeof === R ? (A = "<" + (e(c.type) || "Unknown") + " />", I = " Did you accidentally export a JSX literal instead of a component?") : A = typeof c, console.error( "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", A, I ); if (O.call(x, "key")) { I = e(c); var be = Object.keys(x).filter(function(le) { return le !== "key"; }); A = 0 < be.length ? "{key: someKey, " + be.join(": ..., ") + ": ...}" : "{key: someKey}", Ne[I + A] || (be = 0 < be.length ? "{" + be.join(": ..., ") + ": ...}" : "{}", console.error( `A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`, A, I, be, I ), Ne[I + A] = !0); } if (I = null, E !== void 0 && (t(E), I = "" + E), n(x) && (t(x.key), I = "" + x.key), "key" in x) { E = {}; for (var Le in x) Le !== "key" && (E[Le] = x[Le]); } else E = x; return I && i( E, typeof c == "function" ? c.displayName || c.name || "Unknown" : c ), p(c, I, F, K, s(), E); } function v(c, x) { if (typeof c == "object" && c && c.$$typeof !== ke) { if (W(c)) for (var E = 0; E < c.length; E++) { var A = c[E]; w(A) && _(A, x); } else if (w(c)) c._store && (c._store.validated = 1); else if (c === null || typeof c != "object" ? E = null : (E = j && c[j] || c["@@iterator"], E = typeof E == "function" ? E : null), typeof E == "function" && E !== c.entries && (E = E.call(c), E !== c)) for (; !(c = E.next()).done; ) w(c.value) && _(c.value, x); } } function w(c) { return typeof c == "object" && c !== null && c.$$typeof === R; } function _(c, x) { if (c._store && !c._store.validated && c.key == null && (c._store.validated = 1, x = P(x), !Ee[x])) { Ee[x] = !0; var E = ""; c && c._owner != null && c._owner !== s() && (E = null, typeof c._owner.tag == "number" ? E = e(c._owner.type) : typeof c._owner.name == "string" && (E = c._owner.name), E = " It was passed a child from " + E + "."); var A = D.getCurrentStack; D.getCurrentStack = function() { var K = h(c.type); return A && (K += A() || ""), K; }, console.error( 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', x, E ), D.getCurrentStack = A; } } function P(c) { var x = "", E = s(); return E && (E = e(E.type)) && (x = ` Check the render method of \`` + E + "`."), x || (c = e(c)) && (x = ` Check the top-level render call using <` + c + ">."), x; } var H = ye, R = Symbol.for("react.transitional.element"), C = Symbol.for("react.portal"), N = Symbol.for("react.fragment"), S = Symbol.for("react.strict_mode"), L = Symbol.for("react.profiler"), z = Symbol.for("react.consumer"), k = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), X = Symbol.for("react.suspense"), G = Symbol.for("react.suspense_list"), M = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), b = Symbol.for("react.offscreen"), j = Symbol.iterator, $ = Symbol.for("react.client.reference"), D = H.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, O = Object.prototype.hasOwnProperty, Y = Object.assign, V = Symbol.for("react.client.reference"), W = Array.isArray, B = 0, U, Z, ne, ee, oe, J, re; o.__reactDisabledLog = !0; var fe, ce, pe = !1, se = new (typeof WeakMap == "function" ? WeakMap : Map)(), ke = Symbol.for("react.client.reference"), ve, me = {}, Ne = {}, Ee = {}; He.Fragment = N, He.jsx = function(c, x, E, A, K) { return m(c, x, E, !1, A, K); }, He.jsxs = function(c, x, E, A, K) { return m(c, x, E, !0, A, K); }; }()), He; } var Mt; function vt() { return Mt || (Mt = 1, process.env.NODE_ENV === "production" ? Xe.exports = Mr() : Xe.exports = Sr()), Xe.exports; } var g = vt(); const jr = "_container_132e7_1", St = { container: jr }, kr = "_tooltip_6a7sr_1", Lr = { tooltip: kr }, lr = [ "rgb(0, 255, 128)", // Neon green "rgb(41, 121, 255)", // Electric blue "rgb(201, 81, 238)", // Pink "rgb(255, 160, 0)", // Amber "rgb(0, 184, 212)", // Dark cyan "rgb(103, 58, 183)", // Royal violet "rgb(224,33,70)", // Red "rgb(0, 121, 107)", // Teal storm "rgb(255, 193, 7)" // Solar gold ], Pr = [ "rgb(0, 200, 83)", // Bright green "rgb(25, 118, 210)", // Medium blue "rgb(244, 143, 177)", // Soft pink "rgb(255, 193, 7)", // Golden amber "rgb(3, 169, 244)", // Sky blue "rgb(156, 39, 176)", // Vibrant violet "rgb(229, 57, 53)", // Warm red "rgb(0, 137, 123)", // Ocean teal "rgb(255, 160, 0)" // Deep yellow-orange ]; var he = {}, ot, jt; function Or() { return jt || (jt = 1, ot = function(r, t, o, u) { var a = o ? o.call(u, r, t) : void 0; if (a !== void 0) return !!a; if (r === t) return !0; if (typeof r != "object" || !r || typeof t != "object" || !t) return !1; var d = Object.keys(r), l = Object.keys(t); if (d.length !== l.length) return !1; for (var h = Object.prototype.hasOwnProperty.bind(t), s = 0; s < d.length; s++) { var n = d[s]; if (!h(n)) return !1; var i = r[n], f = t[n]; if (a = o ? o.call(u, i, f, n) : void 0, a === !1 || a === void 0 && i !== f) return !1; } return !0; }), ot; } var kt; function Dr() { if (kt) return he; kt = 1, Object.defineProperty(he, "__esModule", { value: !0 }), he.PreOrder = he.ReverseInOrder = he.InOrder = he.IntervalTree = he.Node = void 0; var e = Or(); function r(s, n) { return s < n ? n : s; } function t(s) { return s === void 0 ? -1 : s.height; } var o = ( /** @class */ function() { function s(n, i) { this.intervalTree = n, this.records = [], this.height = 0, this.key = i.low, this.max = i.high, this.records.push(i); } return s.prototype.getNodeHigh = function() { for (var n = this.records[0].high, i = 1; i < this.records.length; i++) this.records[i].high > n && (n = this.records[i].high); return n; }, s.prototype.updateHeight = function() { this.height = r(t(this.left), t(this.right)) + 1; }, s.prototype.updateMaxOfParents = function() { if (this !== void 0) { var n = this.getNodeHigh(); this.left !== void 0 && this.right !== void 0 ? this.max = r(r(this.left.max, this.right.max), n) : this.left !== void 0 && this.right === void 0 ? this.max = r(this.left.max, n) : this.left === void 0 && this.right !== void 0 ? this.max = r(this.right.max, n) : this.max = n, this.parent && this.parent.updateMaxOfParents(); } }, s.prototype._updateMaxAfterRightRotate = function() { var n = this.parent, i = n.left, f = i.getNodeHigh(); i.left === void 0 && i.right !== void 0 ? i.max = r(f, i.right.max) : i.left !== void 0 && i.right === void 0 ? i.max = r(f, i.left.max) : i.left === void 0 && i.right === void 0 ? i.max = f : i.max = r(r(i.left.max, i.right.max), f); var p = this.getNodeHigh(); this.left === void 0 && this.right !== void 0 ? this.max = r(p, this.right.max) : this.left !== void 0 && this.right === void 0 ? this.max = r(p, this.left.max) : this.left === void 0 && this.right === void 0 ? this.max = p : this.max = r(r(this.left.max, this.right.max), p), n.max = r(r(n.left.max, n.right.max), n.getNodeHigh()); }, s.prototype._updateMaxAfterLeftRotate = function() { var n = this.parent, i = n.right, f = i.getNodeHigh(); i.left === void 0 && i.right !== void 0 ? i.max = r(f, i.right.max) : i.left !== void 0 && i.right === void 0 ? i.max = r(f, i.left.max) : i.left === void 0 && i.right === void 0 ? i.max = f : i.max = r(r(i.left.max, i.right.max), f); var p = this.getNodeHigh(); this.left === void 0 && this.right !== void 0 ? this.max = r(p, this.right.max) : this.left !== void 0 && this.right === void 0 ? this.max = r(p, this.left.max) : this.left === void 0 && this.right === void 0 ? this.max = p : this.max = r(r(this.left.max, this.right.max), p), n.max = r(r(n.left.max, i.max), n.getNodeHigh()); }, s.prototype._leftRotate = function() { var n = this.right; n.parent = this.parent, n.parent === void 0 ? this.intervalTree.root = n : n.parent.left === this ? n.parent.left = n : n.parent.right === this && (n.parent.right = n), this.right = n.left, this.right !== void 0 && (this.right.parent = this), n.left = this, this.parent = n, this.updateHeight(), n.updateHeight(); }, s.prototype._rightRotate = function() { var n = this.left; n.parent = this.parent, n.parent === void 0 ? this.intervalTree.root = n : n.parent.left === this ? n.parent.left = n : n.parent.right === this && (n.parent.right = n), this.left = n.right, this.left !== void 0 && (this.left.parent = this), n.right = this, this.parent = n, this.updateHeight(), n.updateHeight(); }, s.prototype._rebalance = function() { if (t(this.left) >= 2 + t(this.right)) { var n = this.left; t(n.left) >= t(n.right) ? (this._rightRotate(), this._updateMaxAfterRightRotate()) : (n._leftRotate(), this._rightRotate(), this._updateMaxAfterRightRotate()); } else if (t(this.right) >= 2 + t(this.left)) { var i = this.right; t(i.right) >= t(i.left) ? (this._leftRotate(), this._updateMaxAfterLeftRotate()) : (i._rightRotate(), this._leftRotate(), this._updateMaxAfterLeftRotate()); } }, s.prototype.insert = function(n) { n.low < this.key ? this.left === void 0 ? (this.left = new s(this.intervalTree, n), this.left.parent = this) : this.left.insert(n) : this.right === void 0 ? (this.right = new s(this.intervalTree, n), this.right.parent = this) : this.right.insert(n), this.max < n.high && (this.max = n.high), this.updateHeight(), this._rebalance(); }, s.prototype._getOverlappingRecords = function(n, i, f) { if (n.key <= f && i <= n.getNodeHigh()) { for (var p = [], m = 0; m < n.records.length; m++) n.records[m].high >= i && p.push(n.records[m]); return p; } return []; }, s.prototype.search = function(n, i) { if (this === void 0) return []; var f = [], p = [], m = []; return n > this.max ? [] : (this.left !== void 0 && this.left.max >= n && (f = this.left.search(n, i)), p = this._getOverlappingRecords(this, n, i), i < this.key ? f.concat(p) : (this.right !== void 0 && (m = this.right.search(n, i)), f.concat(p, m))); }, s.prototype.searchExisting = function(n) { if (this !== void 0) { if (this.key === n) return this; if (n < this.key) { if (this.left !== void 0) return this.left.searchExisting(n); } else if (this.right !== void 0) return this.right.searchExisting(n); } }, s.prototype._minValue = function() { return this.left === void 0 ? this : this.left._minValue(); }, s.prototype.remove = function(n) { var i = this.parent; if (n.key < this.key) return this.left !== void 0 ? this.left.remove(n) : void 0; if (n.key > this.key) return this.right !== void 0 ? this.right.remove(n) : void 0; if (this.left !== void 0 && this.right !== void 0) { var f = this.right._minValue(); return this.key = f.key, this.records = f.records, this.right.remove(this); } else { if (i.left === this) return this.right !== void 0 ? (i.left = this.right, this.right.parent = i) : (i.left = this.left, this.left !== void 0 && (this.left.parent = i)), i.updateMaxOfParents(), i.updateHeight(), i._rebalance(), this; if (i.right === this) return this.right !== void 0 ? (i.right = this.right, this.right.parent = i) : (i.right = this.left, this.left !== void 0 && (this.left.parent = i)), i.updateMaxOfParents(), i.updateHeight(), i._rebalance(), this; } }, s; }() ); he.Node = o; var u = ( /** @class */ function() { function s() { this.count = 0; } return s.prototype.insert = function(n) { if (n.low > n.high) throw new Error("`low` value must be lower or equal to `high` value"); if (this.root === void 0) return this.root = new o(this, n), this.count++, !0; var i = this.root.searchExisting(n.low); if (i !== void 0) { for (var f = 0; f < i.records.length; f++) if (e(i.records[f], n)) return !1; return i.records.push(n), n.high > i.max && (i.max = n.high, i.parent && i.parent.updateMaxOfParents()), this.count++, !0; } else return this.root.insert(n), this.count++, !0; }, s.prototype.search = function(n, i) { return this.root === void 0 ? [] : this.root.search(n, i); }, s.prototype.remove = function(n) { if (this.root === void 0) return !1; var i = this.root.searchExisting(n.low); if (i === void 0) return !1; if (i.records.length > 1) { for (var f = void 0, p = 0; p < i.records.length; p++) if (e(i.records[p], n)) { f = i.records[p], i.records.splice(p, 1); break; } if (f) { if (f = void 0, n.high === i.max) { var m = i.getNodeHigh(); i.left !== void 0 && i.right !== void 0 ? i.max = r(r(i.left.max, i.right.max), m) : i.left !== void 0 && i.right === void 0 ? i.max = r(i.left.max, m) : i.left === void 0 && i.right !== void 0 ? i.max = r(i.right.max, m) : i.max = m, i.parent && i.parent.updateMaxOfParents(); } return this.count--, !0; } else return !1; } else if (i.records.length === 1) if (e(i.records[0], n)) if (this.root.key === i.key) { var v = new o(this, { low: n.low, high: n.low }); v.left = this.root, this.root.parent = v; var w = this.root.remove(i); return this.root = v.left, this.root !== void 0 && (this.root.parent = void 0), w ? (w = void 0, this.count--, !0) : !1; } else { var w = this.root.remove(i); return w ? (w = void 0, this.count--, !0) : !1; } else return !1; else return !1; }, s.prototype.inOrder = function() { return new d(this.root); }, s.prototype.reverseInOrder = function() { return new l(this.root); }, s.prototype.preOrder = function() { return new h(this.root); }, s; }() ); he.IntervalTree = u; var a = ( /** @class */ function() { function s() { this.tree = new u(); } return s.prototype.insert = function(n, i, f) { return this.tree.insert({ low: n, high: i, data: f }); }, s.prototype.remove = function(n, i, f) { return this.tree.remove({ low: n, high: i, data: f }); }, s.prototype.search = function(n, i) { return this.tree.search(n, i).map(function(f) { return f.data; }); }, s.prototype.inOrder = function() { return this.tree.inOrder(); }, s.prototype.reverseInOrder = function() { return this.tree.reverseInOrder(); }, s.prototype.preOrder = function() { return this.tree.preOrder(); }, Object.defineProperty(s.prototype, "count", { get: function() { return this.tree.count; }, enumerable: !1, configurable: !0 }), s; }() ); he.default = a; var d = ( /** @class */ function() { function s(n) { this.stack = [], n !== void 0 && this.push(n); } return s.prototype[Symbol.iterator] = function() { return this; }, s.prototype.next = function() { return this.currentNode === void 0 ? { done: !0, value: void 0 } : this.i < this.currentNode.records.length ? { done: !1, value: this.currentNode.records[this.i++] } : (this.currentNode.right !== void 0 ? this.push(this.currentNode.right) : this.pop(), this.next()); }, s.prototype.push = function(n) { for (this.currentNode = n, this.i = 0; this.currentNode.left !== void 0; ) this.stack.push(this.currentNode), this.currentNode = this.currentNode.left; }, s.prototype.pop = function() { this.currentNode = this.stack.pop(), this.i = 0; }, s; }() ); he.InOrder = d; var l = ( /** @class */ function() { function s(n) { this.stack = [], n !== void 0 && this.push(n); } return s.prototype[Symbol.iterator] = function() { return this; }, s.prototype.next = function() { return this.currentNode === void 0 ? { done: !0, value: void 0 } : this.currentNode.records.length && this.i >= 0 ? { done: !1, value: this.currentNode.records[this.i--] } : (this.currentNode.left !== void 0 ? this.push(this.currentNode.left) : this.pop(), this.next()); }, s.prototype.push = function(n) { var i, f, p, m; for (this.currentNode = n, this.i = ((f = (i = this.currentNode) === null || i === void 0 ? void 0 : i.records.length) !== null && f !== void 0 ? f : 0) - 1; this.currentNode.right !== void 0; ) this.stack.push(this.currentNode), this.currentNode = this.currentNode.right, this.i = ((m = (p = this.currentNode) === null || p === void 0 ? void 0 : p.records.length) !== null && m !== void 0 ? m : 0) - 1; }, s.prototype.pop = function() { var n, i; this.currentNode = this.stack.pop(), this.i = ((i = (n = this.currentNode) === null || n === void 0 ? void 0 : n.records.length) !== null && i !== void 0 ? i : 0) - 1; }, s; }() ); he.ReverseInOrder = l; var h = ( /** @class */ function() { function s(n) { this.stack = [], this.i = 0, this.currentNode = n; } return s.prototype[Symbol.iterator] = function() { return this; }, s.prototype.next = function() { return this.currentNode === void 0 ? { done: !0, value: void 0 } : this.i < this.currentNode.records.length ? { done: !1, value: this.currentNode.records[this.i++] } : (this.currentNode.right !== void 0 && this.push(this.currentNode.right), this.currentNode.left !== void 0 && this.push(this.currentNode.left), this.pop(), this.next()); }, s.prototype.push = function(n) { this.stack.push(n); }, s.prototype.pop = function() { this.currentNode = this.stack.pop(), this.i = 0; }, s; }() ); return he.PreOrder = h, he; } var zr = Dr(); const ur = /* @__PURE__ */ Se(zr), ge = 40, mt = 20, cr = 2, hr = 16, Oe = 24, Lt = { hash: "defaultCommit", branch: "unknown", parents: [], children: [], authorDate: (/* @__PURE__ */ new Date()).toString(), message: "Working tree index", committerDate: (/* @__PURE__ */ new Date()).toString(), isBranchTip: !1 }, dr = nt({ headCommit: Lt, indexCommit: Lt, currentBranch: "master", showTable: !0, showBranchesTags: !0, selectedCommit: void 0, setSelectedCommit: (e) => { console.debug(`Tried to invoke setSelectedCommit(${JSON.stringify(e)}) before the GitContext was initialised.`); }, previewedCommit: void 0, setPreviewedCommit: (e) => { console.debug(`Tried to invoke setPreviewedCommit(${JSON.stringify(e)}) before the GitContext was initialised.`); }, graphOrientation: "normal", setGraphOrientation: (e) => { console.debug(`Tried to invoke setGraphOrientation(${e}) before the GitContext was initialised.`); }, graphData: { children: /* @__PURE__ */ new Map(), edges: new ur(), graphWidth: 0, commits: [], positions: /* @__PURE__ */ new Map(), parents: /* @__PURE__ */ new Map(), hashToCommit: /* @__PURE__ */ new Map() }, rowSpacing: 0, graphWidth: 300, nodeSize: mt, setNodeSize: (e) => { console.debug(`Tried to invoke setNodeSize(${e}) before the GitContext was initialised.`); }, setGraphWidth: (e) => { console.debug(`Tried to invoke setGraphWidth(${e}) before the GitContext was initialised.`); }, isServerSidePaginated: !1, paging: { endIndex: 0, startIndex: 0 }, isIndexVisible: !0 }), te = () => it(dr), fr = nt({ colours: lr, theme: "light" }), Vr = () => it(fr), Pt = (e) => { if (e < 1) return []; const r = []; if (e === 1) r.push("rgb(54,229,234)"); else for (let t = 0; t < e; t++) { const o = t / (e - 1) * 360, u = t === 0 ? 0 : t === e - 1 ? 359 : o, a = Hr(u, 100, 50); r.push(`rgb(${a[0]}, ${a[1]}, ${a[2]})`); } return r; }, Hr = (e, r, t) => { r /= 100, t /= 100; const o = (d) => (d + e / 30) % 12, u = r * Math.min(t, 1 - t), a = (d) => Math.round((t - u * Math.max(-1, Math.min(o(d) - 3, Math.min(9 - o(d), 1)))) * 255); return [a(0), a(8), a(4)]; }, Ir = ({ children: e, theme: r, colours: t, graphWidth: o }) => { const { shiftAlphaChannel: u } = ue(), a = q(() => { switch (t) { case "rainbow-light": return Pt(o + 1); case "rainbow-dark": return Pt(o + 1).map((l) => u(l, 0.6)); case "neon-aurora-dark": return lr; case "neon-aurora-light": return Pr; default: return r === "light" ? t : t.map((l) => u(l, 0.6)); } }, [t, o, u, r]), d = q(() => ({ colours: a, theme: r }), [r, a]); return /* @__PURE__ */ g.jsx(fr.Provider, { value: d, children: e }); }, ue = () => { const { graphData: e } = te(), { theme: r, colours: t } = Vr(), o = q(() => r === "dark" ? "rgba(70,70,70,0.8)" : "rgba(231, 231, 231, 0.5)", [r]), u = q(() => r === "dark" ? "rgb(255, 255, 255)" : "rgb(0, 0, 0)", [r]), a = ie((n, i) => { const f = n == null ? void 0 : n.match(/\d+/g); if (n && f != null) { const [p, m, v] = f.map(Number), w = r === "dark" ? "rgb(0, 0, 0)" : "rgb(255, 255, 255)", [_, P, H] = w.match(/\d+/g).map(Number), R = Math.round(p * i + _ * (1 - i)), C = Math.round(m * i + P * (1 - i)), N = Math.round(v * i + H * (1 - i)); return `rgb(${R}, ${C}, ${N})`; } return n; }, [r]), d = ie((n, i) => `rgba(${n == null ? void 0 : n.replace("rgb(", "").replace(")", "")}, ${i})`, []), l = ie((n) => { const i = t[n]; return i || t[n % t.length]; }, [t]), h = ie((n) => { if (n.hash === "index") return l(0); const i = e.positions.get(n.hash); if (i) { const f = i[1]; return l(f); } return console.warn(`Commit ${n.hash} did not have a mapped graph position`), "rgb(0, 0, 0)"; }, [l, e.positions]), s = ie((n) => r === "dark" ? a(h(n), 0.2) : a(h(n), 0.1), [h, a, r]); return { theme: r, hoverColour: o, textColour: u, getTooltipBackground: s, reduceOpacity: d, getCommitColour: h, shiftAlphaChannel: a, getGraphColumnColour: l, hoverTransitionDuration: 0.3 }; }, Ar = ({ id: e, commit: r }) => { const { textColour: t, getTooltipBackground: o, getCommitColour: u } = ue(), a = o(r); return /* @__PURE__ */ g.jsx( "div", { className: Lr.tooltip, id: `tag-${e}-tooltip`, "data-testid": `tag-${e}-tooltip`, style: { color: t, background: a, border: `2px solid ${u(r)}` }, children: r.branch } ); }, Yr = "_tagContainer_ioghg_1", Wr = "_tag_ioghg_1", Br = "_tagLine_ioghg_22", st = { tagContainer: Yr, tag: Wr, tagLine: Br }; var Ie = {}, Ae = {}, Ot; function qr() { if (Ot) return Ae; Ot = 1, Object.defineProperty(Ae, "__esModule", { value: !0 }), Ae.PopoverPortal = void 0; var e = ye, r = Tr, t = function(o) { var u = o.container, a = o.element, d = o.scoutElement, l = o.children; return (0, e.useLayoutEffect)(function() { return u.appendChild(a), u.appendChild(d), function() { u.removeChild(a), u.removeChild(d); }; }, [u, a, d]), (0, r.createPortal)(l, a); }; return Ae.PopoverPortal = t, Ae; } var Ye = {}, Dt; function bt() { return Dt || (Dt = 1, function(e) { var r = Ye && Ye.__assign || function() { return r = Object.assign || function(h) { for (var s, n = 1, i = arguments.length; n < i; n++) { s = arguments[n]; for (var f in s) Object.prototype.hasOwnProperty.call(s, f) && (h[f] = s[f]); } return h; }, r.apply(this, arguments); }; Object.defineProperty(e, "__esModule", { value: !0 }), e.getNudgedPopoverRect = e.getNewPopoverRect = e.popoverRectForPosition = e.createContainer = e.rectsAreEqual = e.createRect = e.EMPTY_RECT = void 0, e.EMPTY_RECT = { top: 0, left: 0, right: 0, bottom: 0, width: 0, height: 0 }; var t = function(h) { var s = h.top, n = h.left, i = h.width, f = h.height; return { top: s, left: n, width: i, height: f, right: n + i, bottom: s + f }; }; e.createRect = t; var o = function(h, s) { return h === s || (h == null ? void 0 : h.bottom) === (s == null ? void 0 : s.bottom) && (h == null ? void 0 : h.height) === (s == null ? void 0 : s.height) && (h == null ? void 0 : h.left) === (s == null ? void 0 : s.left) && (h == null ? void 0 : h.right) === (s == null ? void 0 : s.right) && (h == null ? void 0 : h.top) === (s == null ? void 0 : s.top) && (h == null ? void 0 : h.width) === (s == null ? void 0 : s.width); }; e.rectsAreEqual = o; var u = function(h) { var s = h.containerStyle, n = h.containerClassName, i = window.document.createElement("div"); return n && (i.className = n), Object.assign(i.style, s), i; }; e.createContainer = u; var a = function(h, s, n, i, f) { var p = s.left + s.width / 2, m = s.top + s.height / 2, v = n.width, w = n.height, _, P; switch (h) { case "left": _ = m - w / 2, P = s.left - i - v, f === "start" && (_ = s.top), f === "end" && (_ = s.bottom - w); break; case "bottom": _ = s.bottom + i, P = p - v / 2, f === "start" && (P = s.left), f === "end" && (P = s.right - v); break; case "right": _ = m - w / 2, P = s.right + i, f === "start" && (_ = s.top), f === "end" && (_ = s.bottom - w); break; default: _ = s.top - w - i, P = p - v / 2, f === "start" && (P = s.left), f === "end" && (P = s.right - v); break; } return (0, e.createRect)({ left: P, top: _, width: v, height: w }); }; e.popoverRectForPosition = a; var d = function(h, s) { var n = h.position, i = h.align, f = h.childRect, p = h.popoverRect, m = h.boundaryRect, v = h.padding, w = h.reposition, _ = (0, e.popoverRectForPosition)(n, f, p, v, i), P = w && (n === "top" && _.top < m.top + s || n === "left" && _.left < m.left + s || n === "right" && _.right > m.right - s || n === "bottom" && _.bottom > m.bottom - s); return { rect: _, boundaryViolation: P }; }; e.getNewPopoverRect = d; var l = function(h, s, n) { var i = s.top + n, f = s.left + n, p = s.right - n, m = s.bottom - n, v = h.top < i ? i : h.top; v = v + h.height > m ? m - h.height : v; var w = h.left < f ? f : h.left; return w = w + h.width > p ? p - h.width : w, (0, e.createRect)(r(r({}, h), { top: v, left: w })); }; e.getNudgedPopoverRect = l; }(Ye)), Ye; } var We = {}, Be = {}, zt; function Gr() { if (zt) return Be; zt = 1, Object.defineProperty(Be, "__esModule", { value: !0 }), Be.useElementRef = void 0; var e = ye, r = bt(), t = function(o) { var u = o.containerClassName, a = o.containerStyle, d = (0, e.useRef)(), l = (0, e.useState)(function() { return (0, r.createContainer)({ containerStyle: a, containerClassName: u }); })[0]; return (0, e.useLayoutEffect)(function() { l.className = u; }, [u, l]), (0, e.useLayoutEffect)(function() { Object.assign(l.style, a); }, [a, l]), d.current = l, d; }; return Be.useElementRef = t, Be; } var Vt; function Ur() { if (Vt) return We; Vt = 1, Object.defineProperty(We, "__esModule", { value: !0 }), We.usePopover = void 0; var e = ye, r = bt(), t = Gr(), o = { position: "fixed", overflow: "visible", top: "0px", left: "0px" }, u = { position: "fixed", top: "0px", left: "0px", width: "0px", height: "0px", visibility: "hidden" }, a = function(d) { var l = d.isOpen, h = d.childRef, s = d.positions, n = d.containerClassName, i = d.parentElement, f = d.transform, p = d.transformMode, m = d.align, v = d.padding, w = d.reposition, _ = d.boundaryInset, P = d.boundaryElement, H = d.onPositionPopover, R = (0, t.useElementRef)({ containerClassName: "react-tiny-popover-scout", containerStyle: u }), C = (0, t.useElementRef)({ containerClassName: n != null && n.length > 0 && n !== "react-tiny-popover-container" ? "react-tiny-popover-container ".concat(n) : "react-tiny-popover-container", containerStyle: o }), N = (0, e.useCallback)(function(S) { var L, z, k = S === void 0 ? {} : S, T = k.positionIndex, X = T === void 0 ? 0 : T, G = k.parentRect, M = G === void 0 ? i.getBoundingClientRect() : G, y = k.childRect, b = y === void 0 ? (L = h == null ? void 0 : h.current) === null || L === void 0 ? void 0 : L.getBoundingClientRect() : y, j = k.scoutRect, $ = j === void 0 ? (z = R == null ? void 0 : R.current) === null || z === void 0 ? void 0 : z.getBoundingClientRect() : j, D = k.popoverRect, O = D === void 0 ? C.current.getBoundingClientRect() : D, Y = k.boundaryRect, V = Y === void 0 ? P === i ? M : P.getBoundingClientRect() : Y; if (!(!b || !M || !l)) { if (f && p === "absolute") { var W = typeof f == "function" ? f({ childRect: b, popoverRect: O, parentRect: M, boundaryRect: V, padding: v, align: m, nudgedTop: 0, nudgedLeft: 0, boundaryInset: _, violations: r.EMPTY_RECT, hasViolations: !1 }) : f, B = W.top, U = W.left, Z = Math.round(M.left + U - $.left), ne = Math.round(M.top + B - $.top); C.current.style.transform = "translate(".concat(Z, "px, ").concat(ne, "px)"), H({ childRect: b, popoverRect: (0, r.createRect)({ left: Z, top: ne, width: O.width, height: O.height }), parentRect: M, boundaryRect: V, padding: v, align: m, transform: { top: B, left: U }, nudgedTop: 0, nudgedLeft: 0, boundaryInset: _, violations: r.EMPTY_RECT, hasViolations: !1 }); return; } var ee = X === s.length, oe = ee ? s[0] : s[X], J = (0, r.getNewPopoverRect)({ childRect: b, popoverRect: O, boundaryRect: V, position: oe, align: m, padding: v, reposition: w }, _), re = J.rect, fe = J.boundaryViolation; if (fe && w && !ee) { N({ positionIndex: X + 1, childRect: b, popoverRect: O, parentRect: M, boundaryRect: V }); return; } var ce = re.top, pe = re.left, se = re.width, ke = re.height, ve = w && !ee, me = (0, r.getNudgedPopoverRect)(re, V, _), Ne = me.left, Ee = me.top, c = ce, x = pe; ve && (c = Ee, x = Ne), c = Math.round(c - $.top), x = Math.round(x - $.left), C.current.style.transform = "translate(".concat(x, "px, ").concat(c, "px)"); var E = { top: V.top + _ - c, left: V.left + _ - x, right: x + se - V.right + _, bottom: c + ke - V.bottom + _ }, A = { childRect: b, popoverRect: (0, r.createRect)({ left: x, top: c, width: se, height: ke }), parentRect: M, boundaryRect: V, position: oe, align: m, padding: v, nudgedTop: Ee - ce, nudgedLeft: Ne - pe, boundaryInset: _, violations: { top: E.top <= 0 ? 0 : E.top, left: E.left <= 0 ? 0 : E.left, right: E.right <= 0 ? 0 : E.right, bottom: E.bottom <= 0 ? 0 : E.bottom }, hasViolations: E.top > 0 || E.left > 0 || E.right > 0 || E.bottom > 0 }; if (f) { H(A); var K = typeof f == "function" ? f(A) : f, F = K.top, I = K.left; C.current.style.transform = "translate(".concat(Math.round(x + (I ?? 0)), "px, ").concat(Math.round(c + (F ?? 0)), "px)"), A.nudgedLeft += I ?? 0, A.nudgedTop += F ?? 0, A.transform = { top: F, left: I }; } H(A); } }, [ i, h, R, C, P, l, f, p, s, m, v, w, _, H ]); return { positionPopover: N, popoverRef: C, scoutRef: R }; }; return We.usePopover = a, We; } var qe = {}, Ht; function Fr() { if (Ht) return qe; Ht = 1, Object.defineProperty(qe, "__esModule", { value: !0 }), qe.useMemoizedArray = void 0; var e = ye, r = function(t) { var o = (0, e.useRef)(t), u = (0, e.useMemo)(function() { if (o.current === t) return o.current; if (o.current.length !== t.length) return o.current = t, t; for (var a = 0; a < t.length; a += 1) if (t[a] !== o.current[a]) return o.current = t, t; return o.current; }, [t]); return u; }; return qe.useMemoizedArray = r, qe; } var Ge = {}, It; function Xr() { if (It) return Ge; It = 1, Object.defineProperty(Ge, "__esModule", { value: !0 }), Ge.useHandlePrevValues = void 0; var e = ye, r = function(t) { var o = (0, e.useRef)(t.positions), u = (0, e.useRef)(t.reposition), a = (0, e.useRef)(t.transformMode), d = (0, e.useRef)(t.transform), l = (0, e.useRef)(t.boundaryElement), h = (0, e.useRef)(t.boundaryInset), s = (0, e.useCallback)(function() { o.current = t.positions, u.current = t.reposition, a.current = t.transformMode, d.current = t.transform, l.current = t.boundaryElement, h.current = t.boundaryInset; }, [ t.boundaryElement, t.boundaryInset, t.positions, t.reposition, t.transform, t.transformMode ]); return { prev: { positions: o.current, reposition: u.current, transformMode: a.current, transform: d.current, boundaryElement: l.current, boundaryInset: h.current }, updatePrevValues: s }; }; return Ge.useHandlePrevValues = r, Ge; } var Te = {}, At; function pr() { if (At) return Te; At = 1; var e = Te && Te.__assign || function() { return e = Object.assign || function(o) { for (var u, a = 1, d = arguments.length; a < d; a++) { u = arguments[a]; for (var l in u) Object.prototype.hasOwnProperty.call(u, l) && (o[l] = u[l]); } return o; }, e.apply(this, arguments); }; Object.defineProperty(Te, "__esModule", { value: !0 }), Te.useArrowContainer = void 0; var r = ye, t = function(o) { var u = o.childRect, a = o.popoverRect, d = o.position, l = o.arrowSize, h = o.arrowColor, s = (0, r.useMemo)(function() { return { padding: l }; }, [l]), n = (0, r.useMemo)(function() { return e({ position: "absolute" }, function() { var i = l * 2, f = u.top - a.top + u.height / 2 - i / 2, p = u.left - a.left + u.width / 2 - i / 2, m = l, v = a.width - l, w = a.height - l; switch (p = p < m ? m : p, p = p + i > v ? v - i : p, f = f < m ? m : f, f = f + i > w ? w - i : f, f = Number.isNaN(f) ? 0 : f, p = Number.isNaN(p) ? 0 : p, d) { case "right": return { borderTop: "".concat(l, "px solid transparent"), borderBottom: "".concat(l, "px solid transparent"), borderRight: "".concat(l, "px solid ").concat(h), left: 0, top: f }; case "left": return { borderTop: "".concat(l, "px solid transparent"), borderBottom: "".concat(l, "px solid transparent"), borderLeft: "".concat(l, "px solid ").concat(h), right: 0, top: f }; case "bottom": return { borderLeft: "".concat(l, "px solid transparent"), borderRight: "".concat(l, "px solid transparent"), borderBottom: "".concat(l, "px solid ").concat(h), top: 0, left: p }; case "top": return { borderLeft: "".concat(l, "px solid transparent"), borderRight: "".concat(l, "px solid transparent"), borderTop: