@blueking/ai-blueking 2.1.4-beta.7 → 2.1.4-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/standalone/_baseFor-DZ1vnh4H.js +393 -0
- package/dist/standalone/arc-WNacHY26.js +80 -0
- package/dist/standalone/architecture-YZFGNWBL-pIa_tKdA.js +3 -0
- package/dist/standalone/architectureDiagram-Q4EWVU46-Bfam8Fg3.js +4057 -0
- package/dist/standalone/array-CWNufkl9.js +6 -0
- package/dist/standalone/blockDiagram-DXYQGD6D-vAb9uyF5.js +3033 -0
- package/dist/standalone/c4Diagram-AHTNJAMY-BWACU0ER.js +2961 -0
- package/dist/standalone/channel-Br5ChI8U.js +5 -0
- package/dist/standalone/chunk-2KRD3SAO-Deh6AASy.js +23 -0
- package/dist/standalone/chunk-336JU56O-CFKWNcxR.js +49 -0
- package/dist/standalone/chunk-426QAEUC-D_wKNd3w.js +9 -0
- package/dist/standalone/chunk-4BX2VUAB-DKC_OBWg.js +8 -0
- package/dist/standalone/chunk-4TB4RGXK-HiVG7T1A.js +3254 -0
- package/dist/standalone/chunk-55IACEB6-DBivnNb2.js +8 -0
- package/dist/standalone/chunk-5FUZZQ4R-tiEjqlP4.js +3638 -0
- package/dist/standalone/chunk-5PVQY5BW-BCjrVrWB.js +1299 -0
- package/dist/standalone/chunk-67CJDMHE-BX09W6oy.js +23 -0
- package/dist/standalone/chunk-7N4EOEYR-G144j5Vc.js +35 -0
- package/dist/standalone/chunk-AA7GKIK3-Dx9YCoJ-.js +30 -0
- package/dist/standalone/chunk-BSJP7CBP-DE8WR0MI.js +82 -0
- package/dist/standalone/chunk-CIAEETIT-Bv86XVLB.js +23 -0
- package/dist/standalone/chunk-EDXVE4YY-DE9KzYM-.js +25 -0
- package/dist/standalone/chunk-ENJZ2VHE-DlxIC-A3.js +560 -0
- package/dist/standalone/chunk-FMBD7UC4-DCkBrKFO.js +5 -0
- package/dist/standalone/chunk-FOC6F5B3-C7hwrEZJ.js +23 -0
- package/dist/standalone/chunk-ICPOFSXX-B9JXAgJU.js +2772 -0
- package/dist/standalone/chunk-K5T4RW27-T6hJxJM0.js +16070 -0
- package/dist/standalone/chunk-KGLVRYIC-C0JPhrjn.js +23 -0
- package/dist/standalone/chunk-LIHQZDEY-CiavnvWh.js +64 -0
- package/dist/standalone/chunk-ORNJ4GCN-BtJ79bik.js +31 -0
- package/dist/standalone/chunk-OYMX7WX6-D2UHnmfD.js +2014 -0
- package/dist/standalone/chunk-QZHKN3VN-DhzThSvb.js +15 -0
- package/dist/standalone/chunk-U2HBQHQK-75Isf1R4.js +1896 -0
- package/dist/standalone/chunk-WQLz0Won.js +20 -0
- package/dist/standalone/chunk-X2U36JSP-DSzducJI.js +67 -0
- package/dist/standalone/chunk-XPW4576I-BFhmu0d4.js +1146 -0
- package/dist/standalone/chunk-YZCP3GAM-90EaSO-2.js +60 -0
- package/dist/standalone/chunk-ZZ45TVLE-DUagTZ9d.js +32 -0
- package/dist/standalone/classDiagram-6PBFFD2Q-Bwt78q4N.js +29 -0
- package/dist/standalone/classDiagram-v2-HSJHXN6E-B2qI9-xf.js +29 -0
- package/dist/standalone/clone-CBw-BHXl.js +8 -0
- package/dist/standalone/cose-bilkent-S5V4N54A-DFJ1nlog.js +2250 -0
- package/dist/standalone/cytoscape.esm-DdhenceR.js +18103 -0
- package/dist/standalone/dagre-KV5264BT-CXTBtAae.js +293 -0
- package/dist/standalone/dagre-kfvGmNUa.js +1606 -0
- package/dist/standalone/defaultLocale-bckJcYh1.js +201 -0
- package/dist/standalone/diagram-5BDNPKRD--gLHDKg-.js +101 -0
- package/dist/standalone/diagram-G4DWMVQ6-BwLE9Hsf.js +524 -0
- package/dist/standalone/diagram-MMDJMWI5-CoilYxa0.js +213 -0
- package/dist/standalone/diagram-TYMM5635-BupwRdr6.js +133 -0
- package/dist/standalone/dist-Dlj1jr8W.js +59 -0
- package/dist/standalone/erDiagram-SMLLAGMA-tIdn6ZCM.js +1700 -0
- package/dist/standalone/flatten-CXxC4cn2.js +40 -0
- package/dist/standalone/flowDiagram-DWJPFMVM-C86bLTAY.js +4146 -0
- package/dist/standalone/ganttDiagram-T4ZO3ILL-BT23lv_X.js +3077 -0
- package/dist/standalone/gitGraph-7Q5UKJZL-C-7nG8PF.js +3 -0
- package/dist/standalone/gitGraphDiagram-UUTBAWPF-DT1BGQsP.js +728 -0
- package/dist/standalone/graphlib-DrXiQBFg.js +373 -0
- package/dist/standalone/index.es.min.js +59705 -0
- package/dist/standalone/index.iife.min.js +3502 -0
- package/dist/standalone/index.umd.min.js +3502 -0
- package/dist/standalone/info-OMHHGYJF-BOS7mrON.js +3 -0
- package/dist/standalone/infoDiagram-42DDH7IO-Dx7LFK0B.js +19 -0
- package/dist/standalone/init-B75p2clj.js +15 -0
- package/dist/standalone/isEmpty-CVG4Bj-P.js +35 -0
- package/dist/standalone/ishikawaDiagram-UXIWVN3A-CX4cX3qb.js +718 -0
- package/dist/standalone/journeyDiagram-VCZTEJTY-BCvxmmFn.js +883 -0
- package/dist/standalone/kanban-definition-6JOO6SKY-SVINWaiM.js +973 -0
- package/dist/standalone/katex-CKrw0rbA.js +22016 -0
- package/dist/standalone/line-BF1XS-Ng.js +34 -0
- package/dist/standalone/linear-DGQDIL28.js +289 -0
- package/dist/standalone/mermaid-parser.core-Blz-Qy2h.js +69 -0
- package/dist/standalone/mermaid.core-CHTh1JGx.js +944 -0
- package/dist/standalone/mindmap-definition-QFDTVHPH-1Trzro3y.js +1009 -0
- package/dist/standalone/ordinal-F3U6aXtP.js +65 -0
- package/dist/standalone/packet-4T2RLAQJ-ai5Omp1h.js +3 -0
- package/dist/standalone/path-Dm3C8WEs.js +85 -0
- package/dist/standalone/pie-ZZUOXDRM-Df1rG6QC.js +3 -0
- package/dist/standalone/pieDiagram-DEJITSTG-D5Omb898.js +165 -0
- package/dist/standalone/purify.es-CZ_RvYUu.js +549 -0
- package/dist/standalone/quadrantDiagram-34T5L4WZ-Ct4g9T4o.js +1974 -0
- package/dist/standalone/radar-PYXPWWZC-B2t6k6Fg.js +3 -0
- package/dist/standalone/reduce-DbMsJ4nx.js +532 -0
- package/dist/standalone/requirementDiagram-MS252O5E-CP0BUgnz.js +2221 -0
- package/dist/standalone/rough.esm-UCEI3PYn.js +1352 -0
- package/dist/standalone/sankeyDiagram-XADWPNL6-D6C7yZ3k.js +920 -0
- package/dist/standalone/sequenceDiagram-FGHM5R23-KeodespT.js +4157 -0
- package/dist/standalone/src-CFVe5TPD.js +2146 -0
- package/dist/standalone/stateDiagram-FHFEXIEX-DAupoS9U.js +217 -0
- package/dist/standalone/stateDiagram-v2-QKLJ7IA2-C1Lw_i_z.js +27 -0
- package/dist/standalone/style.css +1 -0
- package/dist/standalone/timeline-definition-GMOUNBTQ-Cwhj84lX.js +1068 -0
- package/dist/standalone/treeView-SZITEDCU-BnoMeJSb.js +3 -0
- package/dist/standalone/treemap-W4RFUUIX-B38XFBZF.js +3 -0
- package/dist/standalone/vennDiagram-DHZGUBPP-_1PHloeO.js +1858 -0
- package/dist/standalone/wardley-RL74JXVD-bB8BBy_Y.js +3 -0
- package/dist/standalone/wardleyDiagram-NUSXRM2D-DRLCx-qh.js +578 -0
- package/dist/standalone/xychartDiagram-5P7HB3ND-Bz2-4Ufi.js +2044 -0
- package/dist/standalone-mount-core.d.ts +34 -0
- package/dist/standalone-mount-core.d.ts.map +1 -0
- package/dist/standalone-mount.d.ts +14 -0
- package/dist/standalone-mount.d.ts.map +1 -0
- package/dist/standalone.d.ts +8 -0
- package/dist/standalone.d.ts.map +1 -0
- package/package.json +12 -3
|
@@ -0,0 +1,728 @@
|
|
|
1
|
+
import { g as e, h as t, p as n } from "./src-CFVe5TPD.js";
|
|
2
|
+
import { B as r, C as i, V as a, W as o, _ as s, a as c, b as l, d as u, q as d, s as f, v as p, y as m } from "./chunk-ICPOFSXX-B9JXAgJU.js";
|
|
3
|
+
import { h, p as g, r as _ } from "./chunk-5PVQY5BW-BCjrVrWB.js";
|
|
4
|
+
import { t as v } from "./chunk-4BX2VUAB-DKC_OBWg.js";
|
|
5
|
+
import { t as y } from "./mermaid-parser.core-Blz-Qy2h.js";
|
|
6
|
+
import { t as b } from "./chunk-QZHKN3VN-DhzThSvb.js";
|
|
7
|
+
//#region ../../node_modules/.pnpm/mermaid@11.14.0/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-UUTBAWPF.mjs
|
|
8
|
+
var x = {
|
|
9
|
+
NORMAL: 0,
|
|
10
|
+
REVERSE: 1,
|
|
11
|
+
HIGHLIGHT: 2,
|
|
12
|
+
MERGE: 3,
|
|
13
|
+
CHERRY_PICK: 4
|
|
14
|
+
}, ee = u.gitGraph, S = /* @__PURE__ */ t(() => _({
|
|
15
|
+
...ee,
|
|
16
|
+
...m().gitGraph
|
|
17
|
+
}), "getConfig"), C = new b(() => {
|
|
18
|
+
let e = S(), t = e.mainBranchName, n = e.mainBranchOrder;
|
|
19
|
+
return {
|
|
20
|
+
mainBranchName: t,
|
|
21
|
+
commits: /* @__PURE__ */ new Map(),
|
|
22
|
+
head: null,
|
|
23
|
+
branchConfig: /* @__PURE__ */ new Map([[t, {
|
|
24
|
+
name: t,
|
|
25
|
+
order: n
|
|
26
|
+
}]]),
|
|
27
|
+
branches: /* @__PURE__ */ new Map([[t, null]]),
|
|
28
|
+
currBranch: t,
|
|
29
|
+
direction: "LR",
|
|
30
|
+
seq: 0,
|
|
31
|
+
options: {}
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
function w() {
|
|
35
|
+
return g({ length: 7 });
|
|
36
|
+
}
|
|
37
|
+
t(w, "getID");
|
|
38
|
+
function T(e, t) {
|
|
39
|
+
let n = /* @__PURE__ */ Object.create(null);
|
|
40
|
+
return e.reduce((e, r) => {
|
|
41
|
+
let i = t(r);
|
|
42
|
+
return n[i] || (n[i] = !0, e.push(r)), e;
|
|
43
|
+
}, []);
|
|
44
|
+
}
|
|
45
|
+
t(T, "uniqBy");
|
|
46
|
+
var te = /* @__PURE__ */ t(function(e) {
|
|
47
|
+
C.records.direction = e;
|
|
48
|
+
}, "setDirection"), ne = /* @__PURE__ */ t(function(t) {
|
|
49
|
+
e.debug("options str", t), t = t?.trim(), t ||= "{}";
|
|
50
|
+
try {
|
|
51
|
+
C.records.options = JSON.parse(t);
|
|
52
|
+
} catch (t) {
|
|
53
|
+
e.error("error while parsing gitGraph options", t.message);
|
|
54
|
+
}
|
|
55
|
+
}, "setOptions"), re = /* @__PURE__ */ t(function() {
|
|
56
|
+
return C.records.options;
|
|
57
|
+
}, "getOptions"), ie = /* @__PURE__ */ t(function(t) {
|
|
58
|
+
let n = t.msg, r = t.id, i = t.type, a = t.tags;
|
|
59
|
+
e.info("commit", n, r, i, a), e.debug("Entering commit:", n, r, i, a);
|
|
60
|
+
let o = S();
|
|
61
|
+
r = f.sanitizeText(r, o), n = f.sanitizeText(n, o), a = a?.map((e) => f.sanitizeText(e, o));
|
|
62
|
+
let s = {
|
|
63
|
+
id: r || C.records.seq + "-" + w(),
|
|
64
|
+
message: n,
|
|
65
|
+
seq: C.records.seq++,
|
|
66
|
+
type: i ?? x.NORMAL,
|
|
67
|
+
tags: a ?? [],
|
|
68
|
+
parents: C.records.head == null ? [] : [C.records.head.id],
|
|
69
|
+
branch: C.records.currBranch
|
|
70
|
+
};
|
|
71
|
+
C.records.head = s, e.info("main branch", o.mainBranchName), C.records.commits.has(s.id) && e.warn(`Commit ID ${s.id} already exists`), C.records.commits.set(s.id, s), C.records.branches.set(C.records.currBranch, s.id), e.debug("in pushCommit " + s.id);
|
|
72
|
+
}, "commit"), ae = /* @__PURE__ */ t(function(t) {
|
|
73
|
+
let n = t.name, r = t.order;
|
|
74
|
+
if (n = f.sanitizeText(n, S()), C.records.branches.has(n)) throw Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${n}")`);
|
|
75
|
+
C.records.branches.set(n, C.records.head == null ? null : C.records.head.id), C.records.branchConfig.set(n, {
|
|
76
|
+
name: n,
|
|
77
|
+
order: r
|
|
78
|
+
}), E(n), e.debug("in createBranch");
|
|
79
|
+
}, "branch"), oe = /* @__PURE__ */ t((t) => {
|
|
80
|
+
let n = t.branch, r = t.id, i = t.type, a = t.tags, o = S();
|
|
81
|
+
n = f.sanitizeText(n, o), r &&= f.sanitizeText(r, o);
|
|
82
|
+
let s = C.records.branches.get(C.records.currBranch), c = C.records.branches.get(n), l = s ? C.records.commits.get(s) : void 0, u = c ? C.records.commits.get(c) : void 0;
|
|
83
|
+
if (l && u && l.branch === n) throw Error(`Cannot merge branch '${n}' into itself.`);
|
|
84
|
+
if (C.records.currBranch === n) {
|
|
85
|
+
let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Cannot merge a branch to itself");
|
|
86
|
+
throw e.hash = {
|
|
87
|
+
text: `merge ${n}`,
|
|
88
|
+
token: `merge ${n}`,
|
|
89
|
+
expected: ["branch abc"]
|
|
90
|
+
}, e;
|
|
91
|
+
}
|
|
92
|
+
if (l === void 0 || !l) {
|
|
93
|
+
let e = /* @__PURE__ */ Error(`Incorrect usage of "merge". Current branch (${C.records.currBranch})has no commits`);
|
|
94
|
+
throw e.hash = {
|
|
95
|
+
text: `merge ${n}`,
|
|
96
|
+
token: `merge ${n}`,
|
|
97
|
+
expected: ["commit"]
|
|
98
|
+
}, e;
|
|
99
|
+
}
|
|
100
|
+
if (!C.records.branches.has(n)) {
|
|
101
|
+
let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Branch to be merged (" + n + ") does not exist");
|
|
102
|
+
throw e.hash = {
|
|
103
|
+
text: `merge ${n}`,
|
|
104
|
+
token: `merge ${n}`,
|
|
105
|
+
expected: [`branch ${n}`]
|
|
106
|
+
}, e;
|
|
107
|
+
}
|
|
108
|
+
if (u === void 0 || !u) {
|
|
109
|
+
let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Branch to be merged (" + n + ") has no commits");
|
|
110
|
+
throw e.hash = {
|
|
111
|
+
text: `merge ${n}`,
|
|
112
|
+
token: `merge ${n}`,
|
|
113
|
+
expected: ["\"commit\""]
|
|
114
|
+
}, e;
|
|
115
|
+
}
|
|
116
|
+
if (l === u) {
|
|
117
|
+
let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Both branches have same head");
|
|
118
|
+
throw e.hash = {
|
|
119
|
+
text: `merge ${n}`,
|
|
120
|
+
token: `merge ${n}`,
|
|
121
|
+
expected: ["branch abc"]
|
|
122
|
+
}, e;
|
|
123
|
+
}
|
|
124
|
+
if (r && C.records.commits.has(r)) {
|
|
125
|
+
let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Commit with id:" + r + " already exists, use different custom id");
|
|
126
|
+
throw e.hash = {
|
|
127
|
+
text: `merge ${n} ${r} ${i} ${a?.join(" ")}`,
|
|
128
|
+
token: `merge ${n} ${r} ${i} ${a?.join(" ")}`,
|
|
129
|
+
expected: [`merge ${n} ${r}_UNIQUE ${i} ${a?.join(" ")}`]
|
|
130
|
+
}, e;
|
|
131
|
+
}
|
|
132
|
+
let d = c || "", p = {
|
|
133
|
+
id: r || `${C.records.seq}-${w()}`,
|
|
134
|
+
message: `merged branch ${n} into ${C.records.currBranch}`,
|
|
135
|
+
seq: C.records.seq++,
|
|
136
|
+
parents: C.records.head == null ? [] : [C.records.head.id, d],
|
|
137
|
+
branch: C.records.currBranch,
|
|
138
|
+
type: x.MERGE,
|
|
139
|
+
customType: i,
|
|
140
|
+
customId: !!r,
|
|
141
|
+
tags: a ?? []
|
|
142
|
+
};
|
|
143
|
+
C.records.head = p, C.records.commits.set(p.id, p), C.records.branches.set(C.records.currBranch, p.id), e.debug(C.records.branches), e.debug("in mergeBranch");
|
|
144
|
+
}, "merge"), se = /* @__PURE__ */ t(function(t) {
|
|
145
|
+
let n = t.id, r = t.targetId, i = t.tags, a = t.parent;
|
|
146
|
+
e.debug("Entering cherryPick:", n, r, i);
|
|
147
|
+
let o = S();
|
|
148
|
+
if (n = f.sanitizeText(n, o), r = f.sanitizeText(r, o), i = i?.map((e) => f.sanitizeText(e, o)), a = f.sanitizeText(a, o), !n || !C.records.commits.has(n)) {
|
|
149
|
+
let e = /* @__PURE__ */ Error("Incorrect usage of \"cherryPick\". Source commit id should exist and provided");
|
|
150
|
+
throw e.hash = {
|
|
151
|
+
text: `cherryPick ${n} ${r}`,
|
|
152
|
+
token: `cherryPick ${n} ${r}`,
|
|
153
|
+
expected: ["cherry-pick abc"]
|
|
154
|
+
}, e;
|
|
155
|
+
}
|
|
156
|
+
let s = C.records.commits.get(n);
|
|
157
|
+
if (s === void 0 || !s) throw Error("Incorrect usage of \"cherryPick\". Source commit id should exist and provided");
|
|
158
|
+
if (a && !(Array.isArray(s.parents) && s.parents.includes(a))) throw /* @__PURE__ */ Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");
|
|
159
|
+
let c = s.branch;
|
|
160
|
+
if (s.type === x.MERGE && !a) throw /* @__PURE__ */ Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");
|
|
161
|
+
if (!r || !C.records.commits.has(r)) {
|
|
162
|
+
if (c === C.records.currBranch) {
|
|
163
|
+
let e = /* @__PURE__ */ Error("Incorrect usage of \"cherryPick\". Source commit is already on current branch");
|
|
164
|
+
throw e.hash = {
|
|
165
|
+
text: `cherryPick ${n} ${r}`,
|
|
166
|
+
token: `cherryPick ${n} ${r}`,
|
|
167
|
+
expected: ["cherry-pick abc"]
|
|
168
|
+
}, e;
|
|
169
|
+
}
|
|
170
|
+
let t = C.records.branches.get(C.records.currBranch);
|
|
171
|
+
if (t === void 0 || !t) {
|
|
172
|
+
let e = /* @__PURE__ */ Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);
|
|
173
|
+
throw e.hash = {
|
|
174
|
+
text: `cherryPick ${n} ${r}`,
|
|
175
|
+
token: `cherryPick ${n} ${r}`,
|
|
176
|
+
expected: ["cherry-pick abc"]
|
|
177
|
+
}, e;
|
|
178
|
+
}
|
|
179
|
+
let o = C.records.commits.get(t);
|
|
180
|
+
if (o === void 0 || !o) {
|
|
181
|
+
let e = /* @__PURE__ */ Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);
|
|
182
|
+
throw e.hash = {
|
|
183
|
+
text: `cherryPick ${n} ${r}`,
|
|
184
|
+
token: `cherryPick ${n} ${r}`,
|
|
185
|
+
expected: ["cherry-pick abc"]
|
|
186
|
+
}, e;
|
|
187
|
+
}
|
|
188
|
+
let l = {
|
|
189
|
+
id: C.records.seq + "-" + w(),
|
|
190
|
+
message: `cherry-picked ${s?.message} into ${C.records.currBranch}`,
|
|
191
|
+
seq: C.records.seq++,
|
|
192
|
+
parents: C.records.head == null ? [] : [C.records.head.id, s.id],
|
|
193
|
+
branch: C.records.currBranch,
|
|
194
|
+
type: x.CHERRY_PICK,
|
|
195
|
+
tags: i ? i.filter(Boolean) : [`cherry-pick:${s.id}${s.type === x.MERGE ? `|parent:${a}` : ""}`]
|
|
196
|
+
};
|
|
197
|
+
C.records.head = l, C.records.commits.set(l.id, l), C.records.branches.set(C.records.currBranch, l.id), e.debug(C.records.branches), e.debug("in cherryPick");
|
|
198
|
+
}
|
|
199
|
+
}, "cherryPick"), E = /* @__PURE__ */ t(function(e) {
|
|
200
|
+
if (e = f.sanitizeText(e, S()), C.records.branches.has(e)) {
|
|
201
|
+
C.records.currBranch = e;
|
|
202
|
+
let t = C.records.branches.get(C.records.currBranch);
|
|
203
|
+
t === void 0 || !t ? C.records.head = null : C.records.head = C.records.commits.get(t) ?? null;
|
|
204
|
+
} else {
|
|
205
|
+
let t = /* @__PURE__ */ Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);
|
|
206
|
+
throw t.hash = {
|
|
207
|
+
text: `checkout ${e}`,
|
|
208
|
+
token: `checkout ${e}`,
|
|
209
|
+
expected: [`branch ${e}`]
|
|
210
|
+
}, t;
|
|
211
|
+
}
|
|
212
|
+
}, "checkout");
|
|
213
|
+
function D(e, t, n) {
|
|
214
|
+
let r = e.indexOf(t);
|
|
215
|
+
r === -1 ? e.push(n) : e.splice(r, 1, n);
|
|
216
|
+
}
|
|
217
|
+
t(D, "upsert");
|
|
218
|
+
function O(t) {
|
|
219
|
+
let n = t.reduce((e, t) => e.seq > t.seq ? e : t, t[0]), r = "";
|
|
220
|
+
t.forEach(function(e) {
|
|
221
|
+
e === n ? r += " *" : r += " |";
|
|
222
|
+
});
|
|
223
|
+
let i = [
|
|
224
|
+
r,
|
|
225
|
+
n.id,
|
|
226
|
+
n.seq
|
|
227
|
+
];
|
|
228
|
+
for (let e in C.records.branches) C.records.branches.get(e) === n.id && i.push(e);
|
|
229
|
+
if (e.debug(i.join(" ")), n.parents && n.parents.length == 2 && n.parents[0] && n.parents[1]) {
|
|
230
|
+
let e = C.records.commits.get(n.parents[0]);
|
|
231
|
+
D(t, n, e), n.parents[1] && t.push(C.records.commits.get(n.parents[1]));
|
|
232
|
+
} else if (n.parents.length == 0) return;
|
|
233
|
+
else if (n.parents[0]) {
|
|
234
|
+
let e = C.records.commits.get(n.parents[0]);
|
|
235
|
+
D(t, n, e);
|
|
236
|
+
}
|
|
237
|
+
t = T(t, (e) => e.id), O(t);
|
|
238
|
+
}
|
|
239
|
+
t(O, "prettyPrintCommitHistory");
|
|
240
|
+
var ce = /* @__PURE__ */ t(function() {
|
|
241
|
+
e.debug(C.records.commits);
|
|
242
|
+
let t = k()[0];
|
|
243
|
+
O([t]);
|
|
244
|
+
}, "prettyPrint"), le = /* @__PURE__ */ t(function() {
|
|
245
|
+
C.reset(), c();
|
|
246
|
+
}, "clear"), ue = /* @__PURE__ */ t(function() {
|
|
247
|
+
return [...C.records.branchConfig.values()].map((e, t) => e.order !== null && e.order !== void 0 ? e : {
|
|
248
|
+
...e,
|
|
249
|
+
order: parseFloat(`0.${t}`)
|
|
250
|
+
}).sort((e, t) => (e.order ?? 0) - (t.order ?? 0)).map(({ name: e }) => ({ name: e }));
|
|
251
|
+
}, "getBranchesAsObjArray"), de = /* @__PURE__ */ t(function() {
|
|
252
|
+
return C.records.branches;
|
|
253
|
+
}, "getBranches"), fe = /* @__PURE__ */ t(function() {
|
|
254
|
+
return C.records.commits;
|
|
255
|
+
}, "getCommits"), k = /* @__PURE__ */ t(function() {
|
|
256
|
+
let t = [...C.records.commits.values()];
|
|
257
|
+
return t.forEach(function(t) {
|
|
258
|
+
e.debug(t.id);
|
|
259
|
+
}), t.sort((e, t) => e.seq - t.seq), t;
|
|
260
|
+
}, "getCommitsArray"), A = {
|
|
261
|
+
commitType: x,
|
|
262
|
+
getConfig: S,
|
|
263
|
+
setDirection: te,
|
|
264
|
+
setOptions: ne,
|
|
265
|
+
getOptions: re,
|
|
266
|
+
commit: ie,
|
|
267
|
+
branch: ae,
|
|
268
|
+
merge: oe,
|
|
269
|
+
cherryPick: se,
|
|
270
|
+
checkout: E,
|
|
271
|
+
prettyPrint: ce,
|
|
272
|
+
clear: le,
|
|
273
|
+
getBranchesAsObjArray: ue,
|
|
274
|
+
getBranches: de,
|
|
275
|
+
getCommits: fe,
|
|
276
|
+
getCommitsArray: k,
|
|
277
|
+
getCurrentBranch: /* @__PURE__ */ t(function() {
|
|
278
|
+
return C.records.currBranch;
|
|
279
|
+
}, "getCurrentBranch"),
|
|
280
|
+
getDirection: /* @__PURE__ */ t(function() {
|
|
281
|
+
return C.records.direction;
|
|
282
|
+
}, "getDirection"),
|
|
283
|
+
getHead: /* @__PURE__ */ t(function() {
|
|
284
|
+
return C.records.head;
|
|
285
|
+
}, "getHead"),
|
|
286
|
+
setAccTitle: a,
|
|
287
|
+
getAccTitle: p,
|
|
288
|
+
getAccDescription: s,
|
|
289
|
+
setAccDescription: r,
|
|
290
|
+
setDiagramTitle: o,
|
|
291
|
+
getDiagramTitle: i
|
|
292
|
+
}, pe = /* @__PURE__ */ t((e, t) => {
|
|
293
|
+
v(e, t), e.dir && t.setDirection(e.dir);
|
|
294
|
+
for (let n of e.statements) me(n, t);
|
|
295
|
+
}, "populate"), me = /* @__PURE__ */ t((n, r) => {
|
|
296
|
+
let i = {
|
|
297
|
+
Commit: /* @__PURE__ */ t((e) => r.commit(he(e)), "Commit"),
|
|
298
|
+
Branch: /* @__PURE__ */ t((e) => r.branch(ge(e)), "Branch"),
|
|
299
|
+
Merge: /* @__PURE__ */ t((e) => r.merge(_e(e)), "Merge"),
|
|
300
|
+
Checkout: /* @__PURE__ */ t((e) => r.checkout(ve(e)), "Checkout"),
|
|
301
|
+
CherryPicking: /* @__PURE__ */ t((e) => r.cherryPick(ye(e)), "CherryPicking")
|
|
302
|
+
}[n.$type];
|
|
303
|
+
i ? i(n) : e.error(`Unknown statement type: ${n.$type}`);
|
|
304
|
+
}, "parseStatement"), he = /* @__PURE__ */ t((e) => ({
|
|
305
|
+
id: e.id,
|
|
306
|
+
msg: e.message ?? "",
|
|
307
|
+
type: e.type === void 0 ? x.NORMAL : x[e.type],
|
|
308
|
+
tags: e.tags ?? void 0
|
|
309
|
+
}), "parseCommit"), ge = /* @__PURE__ */ t((e) => ({
|
|
310
|
+
name: e.name,
|
|
311
|
+
order: e.order ?? 0
|
|
312
|
+
}), "parseBranch"), _e = /* @__PURE__ */ t((e) => ({
|
|
313
|
+
branch: e.branch,
|
|
314
|
+
id: e.id ?? "",
|
|
315
|
+
type: e.type === void 0 ? void 0 : x[e.type],
|
|
316
|
+
tags: e.tags ?? void 0
|
|
317
|
+
}), "parseMerge"), ve = /* @__PURE__ */ t((e) => e.branch, "parseCheckout"), ye = /* @__PURE__ */ t((e) => ({
|
|
318
|
+
id: e.id,
|
|
319
|
+
targetId: "",
|
|
320
|
+
tags: e.tags?.length === 0 ? void 0 : e.tags,
|
|
321
|
+
parent: e.parent
|
|
322
|
+
}), "parseCherryPicking"), be = { parse: /* @__PURE__ */ t(async (t) => {
|
|
323
|
+
let n = await y("gitGraph", t);
|
|
324
|
+
e.debug(n), pe(n, A);
|
|
325
|
+
}, "parse") }, j = 10, M = 40, N = 4, P = 2, F = 8, I = /* @__PURE__ */ new Set([
|
|
326
|
+
"redux",
|
|
327
|
+
"redux-dark",
|
|
328
|
+
"redux-color",
|
|
329
|
+
"redux-dark-color"
|
|
330
|
+
]), L = 12, R = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), xe = /* @__PURE__ */ new Set([
|
|
331
|
+
"dark",
|
|
332
|
+
"redux-dark",
|
|
333
|
+
"redux-dark-color",
|
|
334
|
+
"neo-dark"
|
|
335
|
+
]), z = /* @__PURE__ */ t((e, t, n = !1) => n && e > 0 ? (e - 1) % (t - 1) + 1 : e % t, "calcColorIndex"), B = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Map(), H = 30, U = /* @__PURE__ */ new Map(), W = [], G = 0, K = "LR", Se = /* @__PURE__ */ t(() => {
|
|
336
|
+
B.clear(), V.clear(), U.clear(), G = 0, W = [], K = "LR";
|
|
337
|
+
}, "clear"), q = /* @__PURE__ */ t((e) => {
|
|
338
|
+
let t = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
339
|
+
return (typeof e == "string" ? e.split(/\\n|\n|<br\s*\/?>/gi) : e).forEach((e) => {
|
|
340
|
+
let n = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
341
|
+
n.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), n.setAttribute("dy", "1em"), n.setAttribute("x", "0"), n.setAttribute("class", "row"), n.textContent = e.trim(), t.appendChild(n);
|
|
342
|
+
}), t;
|
|
343
|
+
}, "drawText"), J = /* @__PURE__ */ t((e) => {
|
|
344
|
+
let n, r, i;
|
|
345
|
+
return K === "BT" ? (r = /* @__PURE__ */ t((e, t) => e <= t, "comparisonFunc"), i = Infinity) : (r = /* @__PURE__ */ t((e, t) => e >= t, "comparisonFunc"), i = 0), e.forEach((e) => {
|
|
346
|
+
let t = K === "TB" || K == "BT" ? V.get(e)?.y : V.get(e)?.x;
|
|
347
|
+
t !== void 0 && r(t, i) && (n = e, i = t);
|
|
348
|
+
}), n;
|
|
349
|
+
}, "findClosestParent"), Ce = /* @__PURE__ */ t((e) => {
|
|
350
|
+
let t = "", n = Infinity;
|
|
351
|
+
return e.forEach((e) => {
|
|
352
|
+
let r = V.get(e).y;
|
|
353
|
+
r <= n && (t = e, n = r);
|
|
354
|
+
}), t || void 0;
|
|
355
|
+
}, "findClosestParentBT"), we = /* @__PURE__ */ t((e, t, n) => {
|
|
356
|
+
let r = n, i = n, a = [];
|
|
357
|
+
e.forEach((e) => {
|
|
358
|
+
let n = t.get(e);
|
|
359
|
+
if (!n) throw Error(`Commit not found for key ${e}`);
|
|
360
|
+
n.parents.length ? (r = Ee(n), i = Math.max(r, i)) : a.push(n), De(n, r);
|
|
361
|
+
}), r = i, a.forEach((e) => {
|
|
362
|
+
Oe(e, r, n);
|
|
363
|
+
}), e.forEach((e) => {
|
|
364
|
+
let n = t.get(e);
|
|
365
|
+
if (n?.parents.length) {
|
|
366
|
+
let e = Ce(n.parents);
|
|
367
|
+
r = V.get(e).y - M, r <= i && (i = r);
|
|
368
|
+
let t = B.get(n.branch).pos, a = r - j;
|
|
369
|
+
V.set(n.id, {
|
|
370
|
+
x: t,
|
|
371
|
+
y: a
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
}, "setParallelBTPos"), Te = /* @__PURE__ */ t((e) => {
|
|
376
|
+
let t = J(e.parents.filter((e) => e !== null));
|
|
377
|
+
if (!t) throw Error(`Closest parent not found for commit ${e.id}`);
|
|
378
|
+
let n = V.get(t)?.y;
|
|
379
|
+
if (n === void 0) throw Error(`Closest parent position not found for commit ${e.id}`);
|
|
380
|
+
return n;
|
|
381
|
+
}, "findClosestParentPos"), Ee = /* @__PURE__ */ t((e) => Te(e) + M, "calculateCommitPosition"), De = /* @__PURE__ */ t((e, t) => {
|
|
382
|
+
let n = B.get(e.branch);
|
|
383
|
+
if (!n) throw Error(`Branch not found for commit ${e.id}`);
|
|
384
|
+
let r = n.pos, i = t + j;
|
|
385
|
+
return V.set(e.id, {
|
|
386
|
+
x: r,
|
|
387
|
+
y: i
|
|
388
|
+
}), {
|
|
389
|
+
x: r,
|
|
390
|
+
y: i
|
|
391
|
+
};
|
|
392
|
+
}, "setCommitPosition"), Oe = /* @__PURE__ */ t((e, t, n) => {
|
|
393
|
+
let r = B.get(e.branch);
|
|
394
|
+
if (!r) throw Error(`Branch not found for commit ${e.id}`);
|
|
395
|
+
let i = t + n, a = r.pos;
|
|
396
|
+
V.set(e.id, {
|
|
397
|
+
x: a,
|
|
398
|
+
y: i
|
|
399
|
+
});
|
|
400
|
+
}, "setRootPosition"), ke = /* @__PURE__ */ t((e, t, n, r, i, a) => {
|
|
401
|
+
let { theme: o } = l(), s = I.has(o ?? ""), c = R.has(o ?? ""), u = xe.has(o ?? "");
|
|
402
|
+
if (a === x.HIGHLIGHT) e.append("rect").attr("x", n.x - 10 + (s ? 3 : 0)).attr("y", n.y - 10 + (s ? 3 : 0)).attr("width", s ? 14 : 20).attr("height", s ? 14 : 20).attr("class", `commit ${t.id} commit-highlight${z(i, F, c)} ${r}-outer`), e.append("rect").attr("x", n.x - 6 + (s ? 2 : 0)).attr("y", n.y - 6 + (s ? 2 : 0)).attr("width", s ? 8 : 12).attr("height", s ? 8 : 12).attr("class", `commit ${t.id} commit${z(i, F, c)} ${r}-inner`);
|
|
403
|
+
else if (a === x.CHERRY_PICK) e.append("circle").attr("cx", n.x).attr("cy", n.y).attr("r", s ? 7 : 10).attr("class", `commit ${t.id} ${r}`), e.append("circle").attr("cx", n.x - 3).attr("cy", n.y + 2).attr("r", s ? 2.5 : 2.75).attr("fill", u ? "#000000" : "#fff").attr("class", `commit ${t.id} ${r}`), e.append("circle").attr("cx", n.x + 3).attr("cy", n.y + 2).attr("r", s ? 2.5 : 2.75).attr("fill", u ? "#000000" : "#fff").attr("class", `commit ${t.id} ${r}`), e.append("line").attr("x1", n.x + 3).attr("y1", n.y + 1).attr("x2", n.x).attr("y2", n.y - 5).attr("stroke", u ? "#000000" : "#fff").attr("class", `commit ${t.id} ${r}`), e.append("line").attr("x1", n.x - 3).attr("y1", n.y + 1).attr("x2", n.x).attr("y2", n.y - 5).attr("stroke", u ? "#000000" : "#fff").attr("class", `commit ${t.id} ${r}`);
|
|
404
|
+
else {
|
|
405
|
+
let o = e.append("circle");
|
|
406
|
+
if (o.attr("cx", n.x), o.attr("cy", n.y), o.attr("r", s ? 7 : 10), o.attr("class", `commit ${t.id} commit${z(i, F, c)}`), a === x.MERGE) {
|
|
407
|
+
let a = e.append("circle");
|
|
408
|
+
a.attr("cx", n.x), a.attr("cy", n.y), a.attr("r", s ? 5 : 6), a.attr("class", `commit ${r} ${t.id} commit${z(i, F, c)}`);
|
|
409
|
+
}
|
|
410
|
+
if (a === x.REVERSE) {
|
|
411
|
+
let a = e.append("path"), o = s ? 4 : 5;
|
|
412
|
+
a.attr("d", `M ${n.x - o},${n.y - o}L${n.x + o},${n.y + o}M${n.x - o},${n.y + o}L${n.x + o},${n.y - o}`).attr("class", `commit ${r} ${t.id} commit${z(i, F, c)}`);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}, "drawCommitBullet"), Ae = /* @__PURE__ */ t((e, t, n, r, i) => {
|
|
416
|
+
if (t.type !== x.CHERRY_PICK && (t.customId && t.type === x.MERGE || t.type !== x.MERGE) && i.showCommitLabel) {
|
|
417
|
+
let a = e.append("g"), o = a.insert("rect").attr("class", "commit-label-bkg"), s = a.append("text").attr("x", r).attr("y", n.y + 25).attr("class", "commit-label").text(t.id), c = s.node()?.getBBox();
|
|
418
|
+
if (c && (o.attr("x", n.posWithOffset - c.width / 2 - P).attr("y", n.y + 13.5).attr("width", c.width + 2 * P).attr("height", c.height + 2 * P), K === "TB" || K === "BT" ? (o.attr("x", n.x - (c.width + 4 * N + 5)).attr("y", n.y - 12), s.attr("x", n.x - (c.width + 4 * N)).attr("y", n.y + c.height - 12)) : s.attr("x", n.posWithOffset - c.width / 2), i.rotateCommitLabel)) if (K === "TB" || K === "BT") s.attr("transform", "rotate(-45, " + n.x + ", " + n.y + ")"), o.attr("transform", "rotate(-45, " + n.x + ", " + n.y + ")");
|
|
419
|
+
else {
|
|
420
|
+
let e = -7.5 - (c.width + 10) / 25 * 9.5, t = 10 + c.width / 25 * 8.5;
|
|
421
|
+
a.attr("transform", "translate(" + e + ", " + t + ") rotate(-45, " + r + ", " + n.y + ")");
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}, "drawCommitLabel"), je = /* @__PURE__ */ t((e, t, n, r) => {
|
|
425
|
+
if (t.tags.length > 0) {
|
|
426
|
+
let i = 0, a = 0, o = 0, s = [];
|
|
427
|
+
for (let r of t.tags.reverse()) {
|
|
428
|
+
let t = e.insert("polygon"), c = e.append("circle"), l = e.append("text").attr("y", n.y - 16 - i).attr("class", "tag-label").text(r), u = l.node()?.getBBox();
|
|
429
|
+
if (!u) throw Error("Tag bbox not found");
|
|
430
|
+
a = Math.max(a, u.width), o = Math.max(o, u.height), l.attr("x", n.posWithOffset - u.width / 2), s.push({
|
|
431
|
+
tag: l,
|
|
432
|
+
hole: c,
|
|
433
|
+
rect: t,
|
|
434
|
+
yOffset: i
|
|
435
|
+
}), i += 20;
|
|
436
|
+
}
|
|
437
|
+
for (let { tag: e, hole: t, rect: i, yOffset: c } of s) {
|
|
438
|
+
let s = o / 2, l = n.y - 19.2 - c;
|
|
439
|
+
if (i.attr("class", "tag-label-bkg").attr("points", `
|
|
440
|
+
${r - a / 2 - N / 2},${l + P}
|
|
441
|
+
${r - a / 2 - N / 2},${l - P}
|
|
442
|
+
${n.posWithOffset - a / 2 - N},${l - s - P}
|
|
443
|
+
${n.posWithOffset + a / 2 + N},${l - s - P}
|
|
444
|
+
${n.posWithOffset + a / 2 + N},${l + s + P}
|
|
445
|
+
${n.posWithOffset - a / 2 - N},${l + s + P}`), t.attr("cy", l).attr("cx", r - a / 2 + N / 2).attr("r", 1.5).attr("class", "tag-hole"), K === "TB" || K === "BT") {
|
|
446
|
+
let o = r + c;
|
|
447
|
+
i.attr("class", "tag-label-bkg").attr("points", `
|
|
448
|
+
${n.x},${o + 2}
|
|
449
|
+
${n.x},${o - 2}
|
|
450
|
+
${n.x + j},${o - s - 2}
|
|
451
|
+
${n.x + j + a + 4},${o - s - 2}
|
|
452
|
+
${n.x + j + a + 4},${o + s + 2}
|
|
453
|
+
${n.x + j},${o + s + 2}`).attr("transform", "translate(12,12) rotate(45, " + n.x + "," + r + ")"), t.attr("cx", n.x + N / 2).attr("cy", o).attr("transform", "translate(12,12) rotate(45, " + n.x + "," + r + ")"), e.attr("x", n.x + 5).attr("y", o + 3).attr("transform", "translate(14,14) rotate(45, " + n.x + "," + r + ")");
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}, "drawCommitTags"), Me = /* @__PURE__ */ t((e) => {
|
|
458
|
+
switch (e.customType ?? e.type) {
|
|
459
|
+
case x.NORMAL: return "commit-normal";
|
|
460
|
+
case x.REVERSE: return "commit-reverse";
|
|
461
|
+
case x.HIGHLIGHT: return "commit-highlight";
|
|
462
|
+
case x.MERGE: return "commit-merge";
|
|
463
|
+
case x.CHERRY_PICK: return "commit-cherry-pick";
|
|
464
|
+
default: return "commit-normal";
|
|
465
|
+
}
|
|
466
|
+
}, "getCommitClassType"), Ne = /* @__PURE__ */ t((e, t, n, r) => {
|
|
467
|
+
let i = {
|
|
468
|
+
x: 0,
|
|
469
|
+
y: 0
|
|
470
|
+
};
|
|
471
|
+
if (e.parents.length > 0) {
|
|
472
|
+
let n = J(e.parents);
|
|
473
|
+
if (n) {
|
|
474
|
+
let a = r.get(n) ?? i;
|
|
475
|
+
return t === "TB" ? a.y + M : t === "BT" ? (r.get(e.id) ?? i).y - M : a.x + M;
|
|
476
|
+
}
|
|
477
|
+
} else if (t === "TB") return H;
|
|
478
|
+
else if (t === "BT") return (r.get(e.id) ?? i).y - M;
|
|
479
|
+
else return 0;
|
|
480
|
+
return 0;
|
|
481
|
+
}, "calculatePosition"), Pe = /* @__PURE__ */ t((e, t, n) => {
|
|
482
|
+
let r = K === "BT" && n ? t : t + j, i = B.get(e.branch)?.pos, a = K === "TB" || K === "BT" ? B.get(e.branch)?.pos : r;
|
|
483
|
+
if (a === void 0 || i === void 0) throw Error(`Position were undefined for commit ${e.id}`);
|
|
484
|
+
let o = I.has(l().theme ?? "");
|
|
485
|
+
return {
|
|
486
|
+
x: a,
|
|
487
|
+
y: K === "TB" || K === "BT" ? r : i + (o ? L / 2 + 1 : -2),
|
|
488
|
+
posWithOffset: r
|
|
489
|
+
};
|
|
490
|
+
}, "getCommitPosition"), Y = /* @__PURE__ */ t((e, n, r, i) => {
|
|
491
|
+
let a = e.append("g").attr("class", "commit-bullets"), o = e.append("g").attr("class", "commit-labels"), s = K === "TB" || K === "BT" ? H : 0, c = [...n.keys()], l = i.parallelCommits ?? !1, u = /* @__PURE__ */ t((e, t) => {
|
|
492
|
+
let r = n.get(e)?.seq, i = n.get(t)?.seq;
|
|
493
|
+
return r !== void 0 && i !== void 0 ? r - i : 0;
|
|
494
|
+
}, "sortKeys"), d = c.sort(u);
|
|
495
|
+
K === "BT" && (l && we(d, n, s), d = d.reverse()), d.forEach((e) => {
|
|
496
|
+
let t = n.get(e);
|
|
497
|
+
if (!t) throw Error(`Commit not found for key ${e}`);
|
|
498
|
+
l && (s = Ne(t, K, s, V));
|
|
499
|
+
let c = Pe(t, s, l);
|
|
500
|
+
if (r) {
|
|
501
|
+
let e = Me(t), n = t.customType ?? t.type;
|
|
502
|
+
ke(a, t, c, e, B.get(t.branch)?.index ?? 0, n), Ae(o, t, c, s, i), je(o, t, c, s);
|
|
503
|
+
}
|
|
504
|
+
K === "TB" || K === "BT" ? V.set(t.id, {
|
|
505
|
+
x: c.x,
|
|
506
|
+
y: c.posWithOffset
|
|
507
|
+
}) : V.set(t.id, {
|
|
508
|
+
x: c.posWithOffset,
|
|
509
|
+
y: c.y
|
|
510
|
+
}), s = K === "BT" && l ? s + M : s + M + j, s > G && (G = s);
|
|
511
|
+
});
|
|
512
|
+
}, "drawCommits"), Fe = /* @__PURE__ */ t((e, n, r, i, a) => {
|
|
513
|
+
let o = (K === "TB" || K === "BT" ? r.x < i.x : r.y < i.y) ? n.branch : e.branch, s = /* @__PURE__ */ t((e) => e.branch === o, "isOnBranchToGetCurve"), c = /* @__PURE__ */ t((t) => t.seq > e.seq && t.seq < n.seq, "isBetweenCommits");
|
|
514
|
+
return [...a.values()].some((e) => c(e) && s(e));
|
|
515
|
+
}, "shouldRerouteArrow"), X = /* @__PURE__ */ t((e, t, n = 0) => {
|
|
516
|
+
let r = e + Math.abs(e - t) / 2;
|
|
517
|
+
return n > 5 ? r : W.every((e) => Math.abs(e - r) >= 10) ? (W.push(r), r) : X(e, t - Math.abs(e - t) / 5, n + 1);
|
|
518
|
+
}, "findLane"), Ie = /* @__PURE__ */ t((e, t, n, r) => {
|
|
519
|
+
let { theme: i } = l(), a = R.has(i ?? ""), o = V.get(t.id), s = V.get(n.id);
|
|
520
|
+
if (o === void 0 || s === void 0) throw Error(`Commit positions not found for commits ${t.id} and ${n.id}`);
|
|
521
|
+
let c = Fe(t, n, o, s, r), u = "", d = "", f = 0, p = 0, m = B.get(n.branch)?.index;
|
|
522
|
+
n.type === x.MERGE && t.id !== n.parents[0] && (m = B.get(t.branch)?.index);
|
|
523
|
+
let h;
|
|
524
|
+
if (c) {
|
|
525
|
+
u = "A 10 10, 0, 0, 0,", d = "A 10 10, 0, 0, 1,", f = 10, p = 10;
|
|
526
|
+
let e = o.y < s.y ? X(o.y, s.y) : X(s.y, o.y), n = o.x < s.x ? X(o.x, s.x) : X(s.x, o.x);
|
|
527
|
+
K === "TB" ? o.x < s.x ? h = `M ${o.x} ${o.y} L ${n - f} ${o.y} ${d} ${n} ${o.y + p} L ${n} ${s.y - f} ${u} ${n + p} ${s.y} L ${s.x} ${s.y}` : (m = B.get(t.branch)?.index, h = `M ${o.x} ${o.y} L ${n + f} ${o.y} ${u} ${n} ${o.y + p} L ${n} ${s.y - f} ${d} ${n - p} ${s.y} L ${s.x} ${s.y}`) : K === "BT" ? o.x < s.x ? h = `M ${o.x} ${o.y} L ${n - f} ${o.y} ${u} ${n} ${o.y - p} L ${n} ${s.y + f} ${d} ${n + p} ${s.y} L ${s.x} ${s.y}` : (m = B.get(t.branch)?.index, h = `M ${o.x} ${o.y} L ${n + f} ${o.y} ${d} ${n} ${o.y - p} L ${n} ${s.y + f} ${u} ${n - p} ${s.y} L ${s.x} ${s.y}`) : o.y < s.y ? h = `M ${o.x} ${o.y} L ${o.x} ${e - f} ${u} ${o.x + p} ${e} L ${s.x - f} ${e} ${d} ${s.x} ${e + p} L ${s.x} ${s.y}` : (m = B.get(t.branch)?.index, h = `M ${o.x} ${o.y} L ${o.x} ${e + f} ${d} ${o.x + p} ${e} L ${s.x - f} ${e} ${u} ${s.x} ${e - p} L ${s.x} ${s.y}`);
|
|
528
|
+
} else u = "A 20 20, 0, 0, 0,", d = "A 20 20, 0, 0, 1,", f = 20, p = 20, K === "TB" ? (o.x < s.x && (h = n.type === x.MERGE && t.id !== n.parents[0] ? `M ${o.x} ${o.y} L ${o.x} ${s.y - f} ${u} ${o.x + p} ${s.y} L ${s.x} ${s.y}` : `M ${o.x} ${o.y} L ${s.x - f} ${o.y} ${d} ${s.x} ${o.y + p} L ${s.x} ${s.y}`), o.x > s.x && (u = "A 20 20, 0, 0, 0,", d = "A 20 20, 0, 0, 1,", f = 20, p = 20, h = n.type === x.MERGE && t.id !== n.parents[0] ? `M ${o.x} ${o.y} L ${o.x} ${s.y - f} ${d} ${o.x - p} ${s.y} L ${s.x} ${s.y}` : `M ${o.x} ${o.y} L ${s.x + f} ${o.y} ${u} ${s.x} ${o.y + p} L ${s.x} ${s.y}`), o.x === s.x && (h = `M ${o.x} ${o.y} L ${s.x} ${s.y}`)) : K === "BT" ? (o.x < s.x && (h = n.type === x.MERGE && t.id !== n.parents[0] ? `M ${o.x} ${o.y} L ${o.x} ${s.y + f} ${d} ${o.x + p} ${s.y} L ${s.x} ${s.y}` : `M ${o.x} ${o.y} L ${s.x - f} ${o.y} ${u} ${s.x} ${o.y - p} L ${s.x} ${s.y}`), o.x > s.x && (u = "A 20 20, 0, 0, 0,", d = "A 20 20, 0, 0, 1,", f = 20, p = 20, h = n.type === x.MERGE && t.id !== n.parents[0] ? `M ${o.x} ${o.y} L ${o.x} ${s.y + f} ${u} ${o.x - p} ${s.y} L ${s.x} ${s.y}` : `M ${o.x} ${o.y} L ${s.x + f} ${o.y} ${d} ${s.x} ${o.y - p} L ${s.x} ${s.y}`), o.x === s.x && (h = `M ${o.x} ${o.y} L ${s.x} ${s.y}`)) : (o.y < s.y && (h = n.type === x.MERGE && t.id !== n.parents[0] ? `M ${o.x} ${o.y} L ${s.x - f} ${o.y} ${d} ${s.x} ${o.y + p} L ${s.x} ${s.y}` : `M ${o.x} ${o.y} L ${o.x} ${s.y - f} ${u} ${o.x + p} ${s.y} L ${s.x} ${s.y}`), o.y > s.y && (h = n.type === x.MERGE && t.id !== n.parents[0] ? `M ${o.x} ${o.y} L ${s.x - f} ${o.y} ${u} ${s.x} ${o.y - p} L ${s.x} ${s.y}` : `M ${o.x} ${o.y} L ${o.x} ${s.y + f} ${d} ${o.x + p} ${s.y} L ${s.x} ${s.y}`), o.y === s.y && (h = `M ${o.x} ${o.y} L ${s.x} ${s.y}`));
|
|
529
|
+
if (h === void 0) throw Error("Line definition not found");
|
|
530
|
+
e.append("path").attr("d", h).attr("class", "arrow arrow" + z(m, F, a));
|
|
531
|
+
}, "drawArrow"), Le = /* @__PURE__ */ t((e, t) => {
|
|
532
|
+
let n = e.append("g").attr("class", "commit-arrows");
|
|
533
|
+
[...t.keys()].forEach((e) => {
|
|
534
|
+
let r = t.get(e);
|
|
535
|
+
r.parents && r.parents.length > 0 && r.parents.forEach((e) => {
|
|
536
|
+
Ie(n, t.get(e), r, t);
|
|
537
|
+
});
|
|
538
|
+
});
|
|
539
|
+
}, "drawArrows"), Re = /* @__PURE__ */ t((e, t, n, r) => {
|
|
540
|
+
let { look: i, theme: a, themeVariables: o } = l(), { dropShadow: s, THEME_COLOR_LIMIT: c } = o, u = I.has(a ?? ""), d = R.has(a ?? ""), f = e.append("g");
|
|
541
|
+
t.forEach((e, t) => {
|
|
542
|
+
let a = z(t, u ? c : F, d), o = B.get(e.name)?.pos;
|
|
543
|
+
if (o === void 0) throw Error(`Position not found for branch ${e.name}`);
|
|
544
|
+
let l = K === "TB" || K === "BT" ? o : u ? o + L / 2 + 1 : o - 2, p = f.append("line");
|
|
545
|
+
p.attr("x1", 0), p.attr("y1", l), p.attr("x2", G), p.attr("y2", l), p.attr("class", "branch branch" + a), K === "TB" ? (p.attr("y1", H), p.attr("x1", o), p.attr("y2", G), p.attr("x2", o)) : K === "BT" && (p.attr("y1", G), p.attr("x1", o), p.attr("y2", H), p.attr("x2", o)), W.push(l);
|
|
546
|
+
let m = e.name, h = q(m), g = f.insert("rect"), _ = f.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + a);
|
|
547
|
+
_.node().appendChild(h);
|
|
548
|
+
let v = h.getBBox(), y = u ? 0 : 4, b = u ? 16 : 0, x = u ? L : 0;
|
|
549
|
+
i === "neo" && g.attr("data-look", "neo"), g.attr("class", "branchLabelBkg label" + a).attr("style", i === "neo" ? `filter:${u ? `url(#${r}-drop-shadow)` : s}` : "").attr("rx", y).attr("ry", y).attr("x", -v.width - 4 - (n.rotateCommitLabel === !0 ? 30 : 0)).attr("y", -v.height / 2 + 10).attr("width", v.width + 18 + b).attr("height", v.height + 4 + x), _.attr("transform", "translate(" + (-v.width - 14 - (n.rotateCommitLabel === !0 ? 30 : 0) + b / 2) + ", " + (l - v.height / 2 - 2) + ")"), K === "TB" ? (g.attr("x", o - v.width / 2 - 10).attr("y", 0), _.attr("transform", "translate(" + (o - v.width / 2 - 5) + ", 0)"), u && (g.attr("transform", `translate(${-b / 2 - 3}, ${-x - 10})`), _.attr("transform", "translate(" + (o - v.width / 2 - 5) + ", " + (-x * 2 + 7) + ")"))) : K === "BT" ? (g.attr("x", o - v.width / 2 - 10).attr("y", G), _.attr("transform", "translate(" + (o - v.width / 2 - 5) + ", " + G + ")"), u && (g.attr("transform", `translate(${-b / 2 - 3}, ${x + 10})`), _.attr("transform", "translate(" + (o - v.width / 2 - 5) + ", " + (G + x * 2 + 4) + ")"))) : g.attr("transform", "translate(-19, " + (l - 12 - x / 2) + ")");
|
|
550
|
+
});
|
|
551
|
+
}, "drawBranches"), ze = /* @__PURE__ */ t(function(e, t, n, r, i) {
|
|
552
|
+
return B.set(e, {
|
|
553
|
+
pos: t,
|
|
554
|
+
index: n
|
|
555
|
+
}), t += 50 + (i ? 40 : 0) + (K === "TB" || K === "BT" ? r.width / 2 : 0), t;
|
|
556
|
+
}, "setBranchPosition"), Be = { draw: /* @__PURE__ */ t(function(t, r, i, a) {
|
|
557
|
+
Se(), e.debug("in gitgraph renderer", t + "\n", "id:", r, i);
|
|
558
|
+
let o = a.db;
|
|
559
|
+
if (!o.getConfig) {
|
|
560
|
+
e.error("getConfig method is not available on db");
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
let s = o.getConfig(), c = s.rotateCommitLabel ?? !1;
|
|
564
|
+
U = o.getCommits();
|
|
565
|
+
let u = o.getBranchesAsObjArray();
|
|
566
|
+
K = o.getDirection();
|
|
567
|
+
let f = n(`[id="${r}"]`), { look: p, theme: m, themeVariables: g } = l(), { useGradient: _, gradientStart: v, gradientStop: y, filterColor: b } = g;
|
|
568
|
+
if (_) {
|
|
569
|
+
let e = f.append("defs").append("linearGradient").attr("id", r + "-gradient").attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
|
|
570
|
+
e.append("stop").attr("offset", "0%").attr("stop-color", v).attr("stop-opacity", 1), e.append("stop").attr("offset", "100%").attr("stop-color", y).attr("stop-opacity", 1);
|
|
571
|
+
}
|
|
572
|
+
p === "neo" && I.has(m ?? "") && f.append("defs").append("filter").attr("id", r + "-drop-shadow").attr("height", "130%").attr("width", "130%").append("feDropShadow").attr("dx", "4").attr("dy", "4").attr("stdDeviation", 0).attr("flood-opacity", "0.06").attr("flood-color", b);
|
|
573
|
+
let x = 0;
|
|
574
|
+
u.forEach((e, t) => {
|
|
575
|
+
let n = q(e.name), r = f.append("g"), i = r.insert("g").attr("class", "branchLabel"), a = i.insert("g").attr("class", "label branch-label");
|
|
576
|
+
a.node()?.appendChild(n);
|
|
577
|
+
let o = n.getBBox();
|
|
578
|
+
x = ze(e.name, x, t, o, c), a.remove(), i.remove(), r.remove();
|
|
579
|
+
}), Y(f, U, !1, s), s.showBranches && Re(f, u, s, r), Le(f, U), Y(f, U, !0, s), h.insertTitle(f, "gitTitleText", s.titleTopMargin ?? 0, o.getDiagramTitle()), d(void 0, f, s.diagramPadding, s.useMaxWidth);
|
|
580
|
+
}, "draw") }, Z = 8, Q = /* @__PURE__ */ new Set([
|
|
581
|
+
"redux",
|
|
582
|
+
"redux-dark",
|
|
583
|
+
"redux-color",
|
|
584
|
+
"redux-dark-color"
|
|
585
|
+
]), $ = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), Ve = /* @__PURE__ */ new Set(["neo", "neo-dark"]), He = /* @__PURE__ */ new Set([
|
|
586
|
+
"dark",
|
|
587
|
+
"redux-dark",
|
|
588
|
+
"redux-dark-color",
|
|
589
|
+
"neo-dark"
|
|
590
|
+
]), Ue = /* @__PURE__ */ new Set([
|
|
591
|
+
"redux",
|
|
592
|
+
"redux-dark",
|
|
593
|
+
"redux-color",
|
|
594
|
+
"redux-dark-color",
|
|
595
|
+
"neo",
|
|
596
|
+
"neo-dark"
|
|
597
|
+
]), We = /* @__PURE__ */ t((e) => {
|
|
598
|
+
let { svgId: t } = e, n = "";
|
|
599
|
+
if (e.useGradient && t) for (let r = 0; r < e.THEME_COLOR_LIMIT; r++) n += `
|
|
600
|
+
.label${r} { fill: ${e.mainBkg}; stroke: url(${t}-gradient); stroke-width: ${e.strokeWidth};}
|
|
601
|
+
`;
|
|
602
|
+
return n;
|
|
603
|
+
}, "genGitGraphGradient"), Ge = /* @__PURE__ */ t((e) => {
|
|
604
|
+
let { theme: t, themeVariables: n } = m(), { borderColorArray: r } = n, i = Q.has(t);
|
|
605
|
+
if (Ve.has(t)) {
|
|
606
|
+
let t = "";
|
|
607
|
+
for (let n = 0; n < e.THEME_COLOR_LIMIT; n++) if (n === 0) t += `
|
|
608
|
+
.branch-label${n} { fill: ${e.nodeBorder};}
|
|
609
|
+
.commit${n} { stroke: ${e.nodeBorder}; }
|
|
610
|
+
.commit-highlight${n} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
|
|
611
|
+
.arrow${n} { stroke: ${e.nodeBorder}; }
|
|
612
|
+
.commit-bullets { fill: ${e.nodeBorder}; }
|
|
613
|
+
.commit-cherry-pick${n} { stroke: ${e.nodeBorder}; }
|
|
614
|
+
${We(e)}`;
|
|
615
|
+
else {
|
|
616
|
+
let r = n % Z;
|
|
617
|
+
t += `
|
|
618
|
+
.branch-label${n} { fill: ${e["gitBranchLabel" + r]}; }
|
|
619
|
+
.commit${n} { stroke: ${e["git" + r]}; fill: ${e["git" + r]}; }
|
|
620
|
+
.commit-highlight${n} { stroke: ${e["gitInv" + r]}; fill: ${e["gitInv" + r]}; }
|
|
621
|
+
.arrow${n} { stroke: ${e["git" + r]}; }
|
|
622
|
+
`;
|
|
623
|
+
}
|
|
624
|
+
return t;
|
|
625
|
+
} else if ($.has(t)) {
|
|
626
|
+
let n = "";
|
|
627
|
+
for (let a = 0; a < e.THEME_COLOR_LIMIT; a++) if (a === 0) n += `
|
|
628
|
+
.branch-label${a} { fill: ${e.nodeBorder}; ${i ? `font-weight:${e.noteFontWeight}` : ""} }
|
|
629
|
+
.commit${a} { stroke: ${e.nodeBorder}; }
|
|
630
|
+
.commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.mainBkg}; }
|
|
631
|
+
.label${a} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i ? `font-weight:${e.noteFontWeight}` : ""} }
|
|
632
|
+
.arrow${a} { stroke: ${e.nodeBorder}; }
|
|
633
|
+
.commit-bullets { fill: ${e.nodeBorder}; }
|
|
634
|
+
`;
|
|
635
|
+
else {
|
|
636
|
+
let o = a % r.length;
|
|
637
|
+
n += `
|
|
638
|
+
.branch-label${a} { fill: ${e.nodeBorder}; ${i ? `font-weight:${e.noteFontWeight}` : ""} }
|
|
639
|
+
.commit${a} { stroke: ${r[o]}; fill: ${r[o]}; }
|
|
640
|
+
.commit-highlight${a} { stroke: ${r[o]}; fill: ${r[o]}; }
|
|
641
|
+
.label${a} { fill: ${He.has(t) ? e.mainBkg : r[o]}; stroke: ${r[o]}; stroke-width: ${e.strokeWidth}; }
|
|
642
|
+
.arrow${a} { stroke: ${r[o]}; }
|
|
643
|
+
`;
|
|
644
|
+
}
|
|
645
|
+
return n;
|
|
646
|
+
} else {
|
|
647
|
+
let t = "";
|
|
648
|
+
for (let n = 0; n < e.THEME_COLOR_LIMIT; n++) t += `
|
|
649
|
+
.branch-label${n} { fill: ${e.nodeBorder}; ${i ? `font-weight:${e.noteFontWeight}` : ""} }
|
|
650
|
+
.commit${n} { stroke: ${e.nodeBorder}; }
|
|
651
|
+
.commit-highlight${n} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
|
|
652
|
+
.label${n} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i ? `font-weight:${e.noteFontWeight}` : ""}}
|
|
653
|
+
.arrow${n} { stroke: ${e.nodeBorder}; }
|
|
654
|
+
.commit-bullets { fill: ${e.nodeBorder}; }
|
|
655
|
+
.commit-cherry-pick${n} { stroke: ${e.nodeBorder}; }
|
|
656
|
+
`;
|
|
657
|
+
return t;
|
|
658
|
+
}
|
|
659
|
+
}, "genColor"), Ke = /* @__PURE__ */ t((e) => `${Array.from({ length: e.THEME_COLOR_LIMIT }, (e, t) => t).map((t) => {
|
|
660
|
+
let n = t % Z;
|
|
661
|
+
return `
|
|
662
|
+
.branch-label${t} { fill: ${e["gitBranchLabel" + n]}; }
|
|
663
|
+
.commit${t} { stroke: ${e["git" + n]}; fill: ${e["git" + n]}; }
|
|
664
|
+
.commit-highlight${t} { stroke: ${e["gitInv" + n]}; fill: ${e["gitInv" + n]}; }
|
|
665
|
+
.label${t} { fill: ${e["git" + n]}; }
|
|
666
|
+
.arrow${t} { stroke: ${e["git" + n]}; }
|
|
667
|
+
`;
|
|
668
|
+
}).join("\n")}`, "normalTheme"), qe = {
|
|
669
|
+
parser: be,
|
|
670
|
+
db: A,
|
|
671
|
+
renderer: Be,
|
|
672
|
+
styles: /* @__PURE__ */ t((e) => {
|
|
673
|
+
let { theme: t } = m(), n = Ue.has(t);
|
|
674
|
+
return `
|
|
675
|
+
.commit-id,
|
|
676
|
+
.commit-msg,
|
|
677
|
+
.branch-label {
|
|
678
|
+
fill: lightgrey;
|
|
679
|
+
color: lightgrey;
|
|
680
|
+
font-family: 'trebuchet ms', verdana, arial, sans-serif;
|
|
681
|
+
font-family: var(--mermaid-font-family);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
${n ? Ge(e) : Ke(e)}
|
|
685
|
+
|
|
686
|
+
.branch {
|
|
687
|
+
stroke-width: ${e.strokeWidth};
|
|
688
|
+
stroke: ${e.commitLineColor ?? e.lineColor};
|
|
689
|
+
stroke-dasharray: ${n ? "4 2" : "2"};
|
|
690
|
+
}
|
|
691
|
+
.commit-label { font-size: ${e.commitLabelFontSize}; fill: ${n ? e.nodeBorder : e.commitLabelColor}; ${n ? `font-weight:${e.noteFontWeight};` : ""}}
|
|
692
|
+
.commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${n ? "transparent" : e.commitLabelBackground}; opacity: ${n ? "" : .5}; }
|
|
693
|
+
.tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};}
|
|
694
|
+
.tag-label-bkg { fill: ${n ? e.mainBkg : e.tagLabelBackground}; stroke: ${n ? e.nodeBorder : e.tagLabelBorder}; ${n ? `filter:${e.dropShadow}` : ""} }
|
|
695
|
+
.tag-hole { fill: ${e.textColor}; }
|
|
696
|
+
|
|
697
|
+
.commit-merge {
|
|
698
|
+
stroke: ${n ? e.mainBkg : e.primaryColor};
|
|
699
|
+
fill: ${n ? e.mainBkg : e.primaryColor};
|
|
700
|
+
}
|
|
701
|
+
.commit-reverse {
|
|
702
|
+
stroke: ${n ? e.mainBkg : e.primaryColor};
|
|
703
|
+
fill: ${n ? e.mainBkg : e.primaryColor};
|
|
704
|
+
stroke-width: ${n ? e.strokeWidth : 3};
|
|
705
|
+
}
|
|
706
|
+
.commit-highlight-outer {
|
|
707
|
+
}
|
|
708
|
+
.commit-highlight-inner {
|
|
709
|
+
stroke: ${n ? e.mainBkg : e.primaryColor};
|
|
710
|
+
fill: ${n ? e.mainBkg : e.primaryColor};
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.arrow {
|
|
714
|
+
/* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */
|
|
715
|
+
stroke-width: ${Q.has(t) ? e.strokeWidth : 8};
|
|
716
|
+
stroke-linecap: round;
|
|
717
|
+
fill: none
|
|
718
|
+
}
|
|
719
|
+
.gitTitleText {
|
|
720
|
+
text-anchor: middle;
|
|
721
|
+
font-size: 18px;
|
|
722
|
+
fill: ${e.textColor};
|
|
723
|
+
}
|
|
724
|
+
`;
|
|
725
|
+
}, "getStyles")
|
|
726
|
+
};
|
|
727
|
+
//#endregion
|
|
728
|
+
export { qe as diagram };
|