git-history-ui 3.0.0 → 3.2.0
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/CHANGELOG.md +73 -0
- package/README.md +19 -0
- package/build/frontend/{chunk-2QTYGOOP.js → chunk-B7ZU76GM.js} +1 -1
- package/build/frontend/chunk-HQV5AEMT.js +3 -0
- package/build/frontend/chunk-NDC3FSO4.js +2 -0
- package/build/frontend/chunk-QUDEGJKI.js +1 -0
- package/build/frontend/{chunk-HYRHOB47.js → chunk-R33W2FKN.js} +7 -7
- package/build/frontend/index.html +2 -2
- package/build/frontend/{main-44WYBFGF.js → main-AW2YOC32.js} +1 -1
- package/build/frontend/styles-BOEVKAI2.css +1 -0
- package/dist/backend/cache/sqliteIndex.d.ts +43 -0
- package/dist/backend/cache/sqliteIndex.js +221 -0
- package/dist/backend/cache/sqliteIndex.js.map +1 -0
- package/dist/backend/gitService.d.ts +10 -0
- package/dist/backend/gitService.js +35 -0
- package/dist/backend/gitService.js.map +1 -1
- package/dist/backend/presets.d.ts +18 -0
- package/dist/backend/presets.js +60 -0
- package/dist/backend/presets.js.map +1 -0
- package/dist/backend/server.js +80 -1
- package/dist/backend/server.js.map +1 -1
- package/dist/cli.js +92 -5
- package/dist/cli.js.map +1 -1
- package/package.json +4 -1
- package/build/frontend/chunk-C56FFICU.js +0 -2
- package/build/frontend/chunk-HIERJLKT.js +0 -1
- package/build/frontend/styles-GSJUSSXL.css +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface PresetFilters {
|
|
2
|
+
file?: string;
|
|
3
|
+
since?: string;
|
|
4
|
+
until?: string;
|
|
5
|
+
author?: string;
|
|
6
|
+
search?: string;
|
|
7
|
+
searchMode?: 'classic' | 'nl';
|
|
8
|
+
port?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare class PresetsStore {
|
|
11
|
+
list(): Promise<Record<string, PresetFilters>>;
|
|
12
|
+
get(name: string): Promise<PresetFilters | null>;
|
|
13
|
+
save(name: string, filters: PresetFilters): Promise<void>;
|
|
14
|
+
delete(name: string): Promise<boolean>;
|
|
15
|
+
path(): Promise<string>;
|
|
16
|
+
private load;
|
|
17
|
+
private write;
|
|
18
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PresetsStore = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const os_1 = __importDefault(require("os"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const FILE = path_1.default.join(os_1.default.homedir(), '.git-history-ui', 'presets.json');
|
|
11
|
+
class PresetsStore {
|
|
12
|
+
async list() {
|
|
13
|
+
return (await this.load()).presets;
|
|
14
|
+
}
|
|
15
|
+
async get(name) {
|
|
16
|
+
const data = await this.load();
|
|
17
|
+
return data.presets[name] ?? null;
|
|
18
|
+
}
|
|
19
|
+
async save(name, filters) {
|
|
20
|
+
if (!isSafeName(name))
|
|
21
|
+
throw new Error(`Invalid preset name: ${name}`);
|
|
22
|
+
const data = await this.load();
|
|
23
|
+
data.presets[name] = filters;
|
|
24
|
+
await this.write(data);
|
|
25
|
+
}
|
|
26
|
+
async delete(name) {
|
|
27
|
+
const data = await this.load();
|
|
28
|
+
if (!(name in data.presets))
|
|
29
|
+
return false;
|
|
30
|
+
delete data.presets[name];
|
|
31
|
+
await this.write(data);
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
async path() {
|
|
35
|
+
return FILE;
|
|
36
|
+
}
|
|
37
|
+
async load() {
|
|
38
|
+
try {
|
|
39
|
+
const raw = await fs_1.default.promises.readFile(FILE, 'utf8');
|
|
40
|
+
const parsed = JSON.parse(raw);
|
|
41
|
+
if (parsed?.version === 1 && parsed.presets)
|
|
42
|
+
return parsed;
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
/* missing or corrupt → defaults */
|
|
46
|
+
}
|
|
47
|
+
return { version: 1, presets: {} };
|
|
48
|
+
}
|
|
49
|
+
async write(data) {
|
|
50
|
+
await fs_1.default.promises.mkdir(path_1.default.dirname(FILE), { recursive: true });
|
|
51
|
+
const tmp = `${FILE}.tmp-${process.pid}`;
|
|
52
|
+
await fs_1.default.promises.writeFile(tmp, JSON.stringify(data, null, 2), 'utf8');
|
|
53
|
+
await fs_1.default.promises.rename(tmp, FILE);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.PresetsStore = PresetsStore;
|
|
57
|
+
function isSafeName(name) {
|
|
58
|
+
return /^[a-zA-Z0-9][a-zA-Z0-9._-]{0,40}$/.test(name);
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.js","sourceRoot":"","sources":["../../src/backend/presets.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,4CAAoB;AACpB,gDAAwB;AAiBxB,MAAM,IAAI,GAAG,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,iBAAiB,EAAE,cAAc,CAAC,CAAC;AAExE,MAAa,YAAY;IACvB,KAAK,CAAC,IAAI;QACR,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,IAAY;QACpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;IACpC,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,IAAY,EAAE,OAAsB;QAC7C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,MAAM,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QACjE,MAAM,GAAG,GAAG,GAAG,IAAI,QAAQ,OAAO,CAAC,GAAG,EAAE,CAAC;QACzC,MAAM,YAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QACxE,MAAM,YAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;CACF;AA9CD,oCA8CC;AAED,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,mCAAmC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxD,CAAC"}
|
package/dist/backend/server.js
CHANGED
|
@@ -20,6 +20,7 @@ const llm_1 = require("./llm");
|
|
|
20
20
|
const impact_1 = require("./impact");
|
|
21
21
|
const insights_1 = require("./insights");
|
|
22
22
|
const annotations_1 = require("./annotations");
|
|
23
|
+
const sqliteIndex_1 = require("./cache/sqliteIndex");
|
|
23
24
|
const DEFAULT_PORT = 3000;
|
|
24
25
|
const DEFAULT_HOST = 'localhost';
|
|
25
26
|
async function startServer(port = DEFAULT_PORT, host = DEFAULT_HOST, options = {}) {
|
|
@@ -57,6 +58,7 @@ async function startServer(port = DEFAULT_PORT, host = DEFAULT_HOST, options = {
|
|
|
57
58
|
const llmService = (0, llm_1.getDefaultLlmService)(options.llm ?? {});
|
|
58
59
|
const githubToken = options.githubToken ?? process.env.GITHUB_TOKEN;
|
|
59
60
|
const annotations = new annotations_1.AnnotationsStore(cwd);
|
|
61
|
+
const sqliteIndex = new sqliteIndex_1.SqliteIndex(cwd, (args) => gitService.runRaw(args, { maxBuffer: 256 * 1024 * 1024 }));
|
|
60
62
|
const angularBuildPath = path_1.default.join(__dirname, '../../build/frontend');
|
|
61
63
|
const publicPath = path_1.default.join(__dirname, '../../public');
|
|
62
64
|
const staticDir = fs_1.default.existsSync(angularBuildPath) ? angularBuildPath : publicPath;
|
|
@@ -70,9 +72,59 @@ async function startServer(port = DEFAULT_PORT, host = DEFAULT_HOST, options = {
|
|
|
70
72
|
name: 'git-history-ui',
|
|
71
73
|
version: pkgVersion(),
|
|
72
74
|
llm: { provider: llmService.name, isAi: llmService.isAi },
|
|
73
|
-
githubEnrichment: !!githubToken
|
|
75
|
+
githubEnrichment: !!githubToken,
|
|
76
|
+
sqliteAvailable: sqliteIndex_1.SqliteIndex.isAvailable()
|
|
74
77
|
});
|
|
75
78
|
});
|
|
79
|
+
app.get('/api/index/stats', wrap(async (_req, res) => {
|
|
80
|
+
const stats = await sqliteIndex.stats();
|
|
81
|
+
res.json(stats);
|
|
82
|
+
}));
|
|
83
|
+
app.post('/api/index/build', wrap(async (_req, res) => {
|
|
84
|
+
const stats = await sqliteIndex.build();
|
|
85
|
+
res.json(stats);
|
|
86
|
+
}));
|
|
87
|
+
app.get('/api/commits/stream', (req, res) => {
|
|
88
|
+
res.setHeader('Content-Type', 'text/event-stream');
|
|
89
|
+
res.setHeader('Cache-Control', 'no-cache, no-transform');
|
|
90
|
+
res.setHeader('X-Accel-Buffering', 'no');
|
|
91
|
+
res.setHeader('Connection', 'keep-alive');
|
|
92
|
+
res.flushHeaders?.();
|
|
93
|
+
const send = (event, data) => {
|
|
94
|
+
res.write(`event: ${event}\n`);
|
|
95
|
+
res.write(`data: ${JSON.stringify(data)}\n\n`);
|
|
96
|
+
};
|
|
97
|
+
let cancelled = false;
|
|
98
|
+
req.on('close', () => {
|
|
99
|
+
cancelled = true;
|
|
100
|
+
});
|
|
101
|
+
(async () => {
|
|
102
|
+
try {
|
|
103
|
+
let count = 0;
|
|
104
|
+
const author = stringParam(req.query.author);
|
|
105
|
+
const since = stringParam(req.query.since);
|
|
106
|
+
const until = stringParam(req.query.until);
|
|
107
|
+
const file = stringParam(req.query.file);
|
|
108
|
+
for await (const commit of gitService.streamCommits({ author, since, until, file })) {
|
|
109
|
+
if (cancelled)
|
|
110
|
+
break;
|
|
111
|
+
send('commit', commit);
|
|
112
|
+
count++;
|
|
113
|
+
// Yield to the event loop occasionally so we don't block heartbeats.
|
|
114
|
+
if (count % 50 === 0)
|
|
115
|
+
await new Promise((r) => setImmediate(r));
|
|
116
|
+
}
|
|
117
|
+
if (!cancelled) {
|
|
118
|
+
send('done', { total: count });
|
|
119
|
+
res.end();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
catch (err) {
|
|
123
|
+
send('error', { message: err instanceof Error ? err.message : 'stream error' });
|
|
124
|
+
res.end();
|
|
125
|
+
}
|
|
126
|
+
})();
|
|
127
|
+
});
|
|
76
128
|
app.get('/api/commits', wrap(async (req, res) => {
|
|
77
129
|
const result = await gitService.getCommits({
|
|
78
130
|
file: stringParam(req.query.file),
|
|
@@ -213,6 +265,33 @@ async function startServer(port = DEFAULT_PORT, host = DEFAULT_HOST, options = {
|
|
|
213
265
|
const ok = await annotations.remove(req.params.hash, req.params.id);
|
|
214
266
|
res.status(ok ? 204 : 404).end();
|
|
215
267
|
}));
|
|
268
|
+
/**
|
|
269
|
+
* POST /api/share — generate a shareable view-state URL.
|
|
270
|
+
*
|
|
271
|
+
* The current implementation is purely local: it echoes the supplied
|
|
272
|
+
* `viewState` back as a URL with the state encoded in the query string,
|
|
273
|
+
* so the common case ("send my colleague the link") needs no relay
|
|
274
|
+
* server. Future versions may forward to an opt-in `--share-server`
|
|
275
|
+
* (see CHANGELOG for v3.2 plans).
|
|
276
|
+
*/
|
|
277
|
+
app.post('/api/share', wrap(async (req, res) => {
|
|
278
|
+
const state = req.body?.viewState;
|
|
279
|
+
if (!state || typeof state !== 'object') {
|
|
280
|
+
res.status(400).json({ error: 'viewState body field is required' });
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
// Build a query string from a flat key/value object.
|
|
284
|
+
const params = new URLSearchParams();
|
|
285
|
+
for (const [k, v] of Object.entries(state)) {
|
|
286
|
+
if (v === null || v === undefined || v === '')
|
|
287
|
+
continue;
|
|
288
|
+
params.set(k, String(v));
|
|
289
|
+
}
|
|
290
|
+
const proto = req.headers['x-forwarded-proto'] || (req.protocol || 'http');
|
|
291
|
+
const host = req.headers.host || 'localhost';
|
|
292
|
+
const url = `${proto}://${host}/?${params.toString()}`;
|
|
293
|
+
res.status(201).json({ url, expiresAt: null, mode: 'local' });
|
|
294
|
+
}));
|
|
216
295
|
app.get('/api/blame', wrap(async (req, res) => {
|
|
217
296
|
const file = stringParam(req.query.file);
|
|
218
297
|
if (!file) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/backend/server.ts"],"names":[],"mappings":";;;;;AAqCA,kCAsUC;AA3WD,sDAAkF;AAClF,gDAAwB;AACxB,oDAA4B;AAC5B,8DAAsC;AACtC,4EAA2C;AAC3C,+BAA+D;AAC/D,gDAAwB;AACxB,4CAAoB;AACpB,6CAA+D;AAC/D,gDAAgD;AAChD,sDAA0D;AAC1D,yCAAyC;AACzC,+BAA6D;AAC7D,qCAA2C;AAC3C,yCAA6C;AAC7C,+CAAiD;AAmBjD,MAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,MAAM,YAAY,GAAG,WAAW,CAAC;AAE1B,KAAK,UAAU,WAAW,CAC/B,OAAe,YAAY,EAC3B,OAAe,YAAY,EAC3B,UAAkC,EAAE;IAEpC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAEzC,MAAM,GAAG,GAAG,IAAA,iBAAO,GAAE,CAAC;IACtB,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAC5B,GAAG,CAAC,GAAG,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IAEnC,GAAG,CAAC,GAAG,CACL,IAAA,gBAAM,EAAC;QACL,qBAAqB,EAAE,KAAK;QAC5B,yBAAyB,EAAE,KAAK;QAChC,yBAAyB,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE;KACrD,CAAC,CACH,CAAC;IAEF,GAAG,CA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AE,KAAK,EAAE,EAAE,EAAE;QACvB,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC,+BAA+B,GAAG,EAAE,CAAC,CAAC;QAClD,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE;YAC/B,sCAAsC;YACtC,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,oBAAoB,CAAC,CAAC;YACnD,KAAK,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YACpC,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC;QACpD,CAAC,CAAC;QACF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC/C,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IACnD,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACb,sCAAsC;QACtC,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -10,6 +10,7 @@ const open_1 = __importDefault(require("open"));
|
|
|
10
10
|
const fs_1 = require("fs");
|
|
11
11
|
const path_1 = require("path");
|
|
12
12
|
const server_1 = require("./backend/server");
|
|
13
|
+
const presets_1 = require("./backend/presets");
|
|
13
14
|
const pkg = JSON.parse((0, fs_1.readFileSync)((0, path_1.join)(__dirname, '..', 'package.json'), 'utf8'));
|
|
14
15
|
const program = new commander_1.Command();
|
|
15
16
|
program
|
|
@@ -23,14 +24,97 @@ program
|
|
|
23
24
|
.option('-a, --author <name>', 'filter commits by author')
|
|
24
25
|
.option('--no-open', 'do not automatically open browser')
|
|
25
26
|
.option('--cwd <path>', 'path to the git repository (defaults to cwd)')
|
|
26
|
-
.
|
|
27
|
-
|
|
27
|
+
.option('--llm <provider>', 'LLM provider: heuristic, anthropic, openai (default: auto)')
|
|
28
|
+
.option('--preset <name>', 'load filters from a saved preset')
|
|
29
|
+
.option('--save-preset <name>', 'save the current flags as a preset for next time');
|
|
30
|
+
program
|
|
31
|
+
.command('presets')
|
|
32
|
+
.description('manage saved CLI presets')
|
|
33
|
+
.argument('<action>', 'list | delete')
|
|
34
|
+
.argument('[name]', 'preset name (required for delete)')
|
|
35
|
+
.action(async (action, name) => {
|
|
36
|
+
const store = new presets_1.PresetsStore();
|
|
37
|
+
if (action === 'list') {
|
|
38
|
+
const all = await store.list();
|
|
39
|
+
const entries = Object.entries(all);
|
|
40
|
+
if (entries.length === 0) {
|
|
41
|
+
console.log(chalk_1.default.gray('No presets saved yet. Use --save-preset <name> to create one.'));
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
console.log(chalk_1.default.cyan(`Saved presets (${await store.path()}):`));
|
|
45
|
+
for (const [n, f] of entries) {
|
|
46
|
+
const summary = Object.entries(f)
|
|
47
|
+
.map(([k, v]) => `${k}=${v}`)
|
|
48
|
+
.join(' ');
|
|
49
|
+
console.log(` ${chalk_1.default.bold(n)} ${chalk_1.default.gray(summary || '(no filters)')}`);
|
|
50
|
+
}
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (action === 'delete') {
|
|
54
|
+
if (!name) {
|
|
55
|
+
console.error(chalk_1.default.red('Usage: git-history-ui presets delete <name>'));
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
const ok = await store.delete(name);
|
|
59
|
+
if (ok)
|
|
60
|
+
console.log(chalk_1.default.green(`Deleted preset: ${name}`));
|
|
61
|
+
else {
|
|
62
|
+
console.error(chalk_1.default.yellow(`No such preset: ${name}`));
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
console.error(chalk_1.default.red(`Unknown presets action: ${action}. Use list or delete.`));
|
|
68
|
+
process.exit(1);
|
|
69
|
+
});
|
|
70
|
+
program.parseAsync().then(() => {
|
|
71
|
+
// Skip default-action if a subcommand ran.
|
|
72
|
+
if (program.args[0] === 'presets')
|
|
73
|
+
return;
|
|
74
|
+
void main();
|
|
75
|
+
});
|
|
28
76
|
async function main() {
|
|
77
|
+
const options = program.opts();
|
|
78
|
+
const presetsStore = new presets_1.PresetsStore();
|
|
79
|
+
// Hydrate from saved preset (CLI flags still override).
|
|
80
|
+
if (options.preset) {
|
|
81
|
+
const loaded = await presetsStore.get(options.preset);
|
|
82
|
+
if (!loaded) {
|
|
83
|
+
console.error(chalk_1.default.red(`No such preset: ${options.preset}. Run 'git-history-ui presets list' to see saved ones.`));
|
|
84
|
+
process.exit(1);
|
|
85
|
+
}
|
|
86
|
+
if (!options.file && loaded.file)
|
|
87
|
+
options.file = loaded.file;
|
|
88
|
+
if (!options.since && loaded.since)
|
|
89
|
+
options.since = loaded.since;
|
|
90
|
+
if (!options.author && loaded.author)
|
|
91
|
+
options.author = loaded.author;
|
|
92
|
+
if (options.port === '3000' && loaded.port)
|
|
93
|
+
options.port = String(loaded.port);
|
|
94
|
+
console.log(chalk_1.default.gray(`Loaded preset '${options.preset}'.`));
|
|
95
|
+
}
|
|
29
96
|
const port = parseInt(options.port, 10);
|
|
30
97
|
if (!Number.isFinite(port) || port < 1 || port > 65535) {
|
|
31
98
|
console.error(chalk_1.default.red(`Invalid port: ${options.port}`));
|
|
32
99
|
process.exit(1);
|
|
33
100
|
}
|
|
101
|
+
// Persist before starting if requested.
|
|
102
|
+
if (options.savePreset) {
|
|
103
|
+
const filters = {
|
|
104
|
+
file: options.file,
|
|
105
|
+
since: options.since,
|
|
106
|
+
author: options.author,
|
|
107
|
+
port: port !== 3000 ? port : undefined
|
|
108
|
+
};
|
|
109
|
+
try {
|
|
110
|
+
await presetsStore.save(options.savePreset, filters);
|
|
111
|
+
console.log(chalk_1.default.green(`Saved preset '${options.savePreset}'.`));
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
console.error(chalk_1.default.red(err instanceof Error ? err.message : String(err)));
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
34
118
|
console.log(chalk_1.default.blue('Starting git-history-ui...'));
|
|
35
119
|
let close = () => Promise.resolve();
|
|
36
120
|
try {
|
|
@@ -38,7 +122,8 @@ async function main() {
|
|
|
38
122
|
file: options.file,
|
|
39
123
|
since: options.since,
|
|
40
124
|
author: options.author,
|
|
41
|
-
cwd: options.cwd
|
|
125
|
+
cwd: options.cwd,
|
|
126
|
+
llm: options.llm ? { provider: options.llm } : undefined
|
|
42
127
|
});
|
|
43
128
|
close = result.close;
|
|
44
129
|
console.log(chalk_1.default.green(`Listening on ${result.url}`));
|
|
@@ -53,7 +138,10 @@ async function main() {
|
|
|
53
138
|
console.log(chalk_1.default.gray('\nTips:\n' +
|
|
54
139
|
' • Press Cmd/Ctrl+K in the UI to open the command palette\n' +
|
|
55
140
|
' • Press ? to view keyboard shortcuts\n' +
|
|
56
|
-
' • Press Ctrl+C to stop the server\n'
|
|
141
|
+
' • Press Ctrl+C to stop the server\n' +
|
|
142
|
+
(options.savePreset
|
|
143
|
+
? ` • Resume this view next time with: git-history-ui --preset ${options.savePreset}\n`
|
|
144
|
+
: '')));
|
|
57
145
|
}
|
|
58
146
|
catch (err) {
|
|
59
147
|
console.error(chalk_1.default.red('Failed to start server:'), err instanceof Error ? err.message : err);
|
|
@@ -67,5 +155,4 @@ async function main() {
|
|
|
67
155
|
process.on('SIGINT', () => shutdown('SIGINT'));
|
|
68
156
|
process.on('SIGTERM', () => shutdown('SIGTERM'));
|
|
69
157
|
}
|
|
70
|
-
main();
|
|
71
158
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;AAEA,yCAAoC;AACpC,kDAA0B;AAC1B,gDAAwB;AACxB,2BAAkC;AAClC,+BAA4B;AAC5B,6CAA+C;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;AAEA,yCAAoC;AACpC,kDAA0B;AAC1B,gDAAwB;AACxB,2BAAkC;AAClC,+BAA4B;AAC5B,6CAA+C;AAC/C,+CAAqE;AAErE,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CACpB,IAAA,iBAAY,EAAC,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CACrC,CAAC;AAEzB,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,gBAAgB,CAAC;KACtB,WAAW,CAAC,qDAAqD,CAAC;KAClE,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,eAAe,EAAE,2BAA2B,CAAC;KAClE,MAAM,CAAC,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,CAAC;KAC9D,MAAM,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,WAAW,CAAC;KAC3D,MAAM,CAAC,mBAAmB,EAAE,mCAAmC,CAAC;KAChE,MAAM,CAAC,oBAAoB,EAAE,0CAA0C,CAAC;KACxE,MAAM,CAAC,qBAAqB,EAAE,0BAA0B,CAAC;KACzD,MAAM,CAAC,WAAW,EAAE,mCAAmC,CAAC;KACxD,MAAM,CAAC,cAAc,EAAE,8CAA8C,CAAC;KACtE,MAAM,CAAC,kBAAkB,EAAE,4DAA4D,CAAC;KACxF,MAAM,CAAC,iBAAiB,EAAE,kCAAkC,CAAC;KAC7D,MAAM,CAAC,sBAAsB,EAAE,kDAAkD,CAAC,CAAC;AAEtF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,CAAC;IACF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;AACnD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "git-history-ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Git Intelligence in your browser — natural-language search, PR/feature grouping, time-travel snapshots, file history, blame, commit impact, and an insights dashboard. Optional AI integration (Anthropic / OpenAI).",
|
|
5
5
|
"main": "dist/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -73,6 +73,9 @@
|
|
|
73
73
|
"helmet": "^8.0.0",
|
|
74
74
|
"open": "^8.4.2"
|
|
75
75
|
},
|
|
76
|
+
"optionalDependencies": {
|
|
77
|
+
"better-sqlite3": "^11.5.0"
|
|
78
|
+
},
|
|
76
79
|
"devDependencies": {
|
|
77
80
|
"@types/compression": "^1.7.5",
|
|
78
81
|
"@types/cors": "^2.8.17",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as Wt,b as $t,c as Kt}from"./chunk-36NFLS3P.js";import{a as Yt}from"./chunk-HYRHOB47.js";import{a as Bt,b as jt,c as Ht,h as Gt}from"./chunk-YSTG766K.js";import{a as Ut}from"./chunk-NUMLL3OZ.js";import{a as N}from"./chunk-N7UHDKJ7.js";import{d as At}from"./chunk-3FFYILBL.js";import{a as Zt}from"./chunk-ITIFFECZ.js";import{$ as p,$a as Mt,Ab as h,B as lt,Bb as T,C as ve,Cb as Me,D as ct,Db as Rt,Ea as we,Fb as Ze,Ga as l,Gb as Ye,Hb as Ke,I as dt,Ia as xt,Ja as $e,Jb as de,Ka as bt,Lb as me,Ma as wt,Mb as pe,N as mt,Ob as fe,P as pt,Pa as E,Q as We,Qa as ie,R as Ce,Ra as Y,Rb as Tt,S as xe,Sa as Ue,Sb as q,Ta as v,Tb as F,V as ft,Va as yt,W as D,Wa as oe,Wb as Ft,X as te,Xa as St,Xb as Vt,Z as W,Zb as zt,ab as re,db as f,dc as H,e as ot,ea as w,eb as s,ec as V,fa as y,fb as a,fc as Ee,g as Ge,gb as S,hb as Et,hc as z,i as rt,ib as Ot,j as O,ja as gt,jb as Dt,ka as be,kb as ye,la as ht,lb as Se,lc as Nt,m as at,mb as k,mc as Lt,n as st,nb as b,nc as Oe,oa as C,ob as _,pb as kt,q as j,qa as ut,qb as Pt,ra as _t,s as _e,sa as vt,sb as ae,tb as se,ub as le,va as ne,vb as ce,wb as K,xb as P,yb as It,za as Ct,zb as c}from"./chunk-TQE5NWMZ.js";var De=class i{http=p(Oe);base="/api";list(n){return this.http.get(`${this.base}/annotations/${n}`)}add(n,e,t){return this.http.post(`${this.base}/annotations/${n}`,{author:e,body:t})}remove(n,e){return this.http.delete(`${this.base}/annotations/${n}/${e}`)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};function dn(i,n){if(i&1&&(s(0,"span",37),c(1),a()),i&2){let e=n.$implicit;l(),h(e)}}function mn(i,n){if(i&1&&(s(0,"span",38),c(1),a()),i&2){let e=n.$implicit;l(),h(e)}}function pn(i,n){i&1&&(s(0,"span",39),c(1,"merge"),a())}function fn(i,n){if(i&1&&(s(0,"pre",40),c(1),a()),i&2){let e=_().ngIf;l(),h(e.body)}}function gn(i,n){if(i&1){let e=k();s(0,"div",41)(1,"span",42),c(2,"AI"),a(),s(3,"span",43),c(4),a(),s(5,"button",44),b("click",function(){w(e);let o=_(2);return y(o.explanation.set(null))}),c(6,"\xD7"),a()()}if(i&2){let e=n.ngIf;l(4),h(e)}}function hn(i,n){if(i&1&&(s(0,"div",45),c(1),a()),i&2){let e=n.ngIf;l(),h(e)}}function un(i,n){if(i&1&&(s(0,"li"),c(1),a()),i&2){let e=n.$implicit;l(),h(e)}}function _n(i,n){if(i&1&&(s(0,"li")(1,"code"),c(2),a(),c(3," \u2192 "),s(4,"code"),c(5),a()()),i&2){let e=n.$implicit,t=_(4);l(2),h(t.shortPath(e.from)),l(3),h(t.shortPath(e.to))}}function vn(i,n){if(i&1&&(s(0,"ul",55),v(1,_n,6,2,"li",51),a()),i&2){let e=_().ngIf;l(),f("ngForOf",e.dependencyRipple.slice(0,8))}}function Cn(i,n){i&1&&(s(0,"p",56),c(1,"No JS/TS imports detected in changed files."),a())}function xn(i,n){if(i&1){let e=k();s(0,"li",29),b("click",function(){let o=w(e).$implicit,r=_(3);return y(r.state.selectHash(o.hash))}),s(1,"code"),c(2),a(),s(3,"span"),c(4),a()()}if(i&2){let e=n.$implicit;l(2),h(e.hash.slice(0,7)),l(2),h(e.subject)}}function bn(i,n){if(i&1&&(s(0,"div",46)(1,"div",47)(2,"span"),c(3,"Impact"),a(),s(4,"span",48),c(5),a()(),s(6,"div",49)(7,"div")(8,"h4"),c(9,"Modules"),a(),s(10,"ul",50),v(11,un,2,1,"li",51),a()(),s(12,"div")(13,"h4"),c(14,"Dependency ripple"),a(),v(15,vn,2,1,"ul",52)(16,Cn,2,0,"ng-template",null,1,fe),a(),s(18,"div")(19,"h4"),c(20,"Related commits"),a(),s(21,"ul",53),v(22,xn,5,2,"li",54),a()()()()),i&2){let e=n.ngIf,t=ce(17);l(5),Rt(" ",e.files.length," files \xB7 ",e.modules.length," modules \xB7 ",e.relatedCommits.length," related commits "),l(6),f("ngForOf",e.modules),l(4),f("ngIf",e.dependencyRipple.length)("ngIfElse",t),l(7),f("ngForOf",e.relatedCommits)}}function wn(i,n){if(i&1&&(s(0,"span",57),c(1),a()),i&2){let e=_(2);l(),h(e.files().length)}}function yn(i,n){if(i&1&&(s(0,"span",66),c(1),a()),i&2){let e=_().$implicit;l(),T("+",e.additions)}}function Sn(i,n){if(i&1&&(s(0,"span",67),c(1),a()),i&2){let e=_().$implicit;l(),T("\u2212",e.deletions)}}function Mn(i,n){if(i&1){let e=k();s(0,"div",58)(1,"button",59),b("click",function(){let o=w(e).$implicit,r=_(2);return y(r.selectFile(o))}),S(2,"span",60),s(3,"span",61),c(4),a(),s(5,"span",62),v(6,yn,2,1,"span",63)(7,Sn,2,1,"span",64),a()(),s(8,"button",65),b("click",function(){let o=w(e).$implicit,r=_(2);return y(r.openFileHistory(o.file))}),c(9," \u23F1 "),a()()}if(i&2){let e,t=n.$implicit,o=_(2);l(),P("selected",t.file===((e=o.activeFile())==null?null:e.file)),l(),re("data-status",t.status),l(),f("title",t.file),l(),h(t.file),l(2),f("ngIf",t.additions),l(),f("ngIf",t.deletions)}}function En(i,n){i&1&&(s(0,"div",68),c(1," No files changed. "),a())}function On(i,n){i&1&&(s(0,"div",68),c(1,"Loading\u2026"),a())}function Dn(i,n){if(i&1){let e=k();s(0,"div",69)(1,"div",70)(2,"strong"),c(3),a(),s(4,"span",71),c(5),me(6,"date"),a(),s(7,"button",72),b("click",function(){let o=w(e).$implicit,r=_(2);return y(r.deleteComment(o.id))}),c(8,"\xD7"),a()(),s(9,"p",73),c(10),a()()}if(i&2){let e=n.$implicit;l(3),h(e.author),l(2),h(pe(6,3,e.createdAt,"short")),l(5),h(e.body)}}function kn(i,n){if(i&1){let e=k();ye(0),s(1,"header",3)(2,"div",4)(3,"span",5),c(4),a(),s(5,"span",6),v(6,dn,2,1,"span",7)(7,mn,2,1,"span",8)(8,pn,2,0,"span",9),a()(),s(9,"h2",10),c(10),a(),s(11,"div",11)(12,"span"),c(13),a(),s(14,"span",12),c(15,"\u2022"),a(),s(16,"span"),c(17),me(18,"date"),a()(),v(19,fn,2,1,"pre",13),s(20,"div",14)(21,"button",15),b("click",function(){w(e);let o=_();return y(o.onExplain())}),c(22),a(),s(23,"button",15),b("click",function(){w(e);let o=_();return y(o.onLoadImpact())}),c(24),a(),s(25,"button",16),b("click",function(){w(e);let o=_();return y(o.copyShareLink())}),c(26),a()(),v(27,gn,7,1,"div",17)(28,hn,2,1,"div",18),a(),v(29,bn,23,7,"div",19),s(30,"div",20)(31,"aside",21)(32,"div",22)(33,"span"),c(34,"Files"),a(),v(35,wn,2,1,"span",23),a(),s(36,"div",24),v(37,Mn,10,7,"div",25)(38,En,2,0,"div",26)(39,On,2,0,"div",26),a()(),s(40,"section",27)(41,"details",28)(42,"summary",29),b("click",function(o){w(e);let r=_();return y(r.toggleAnnotations(o))}),c(43),a(),s(44,"div",30),v(45,Dn,11,6,"div",31),s(46,"div",32)(47,"input",33),Ke("ngModelChange",function(o){w(e);let r=_();return Ye(r.commentAuthor,o)||(r.commentAuthor=o),y(o)}),a(),s(48,"textarea",34),Ke("ngModelChange",function(o){w(e);let r=_();return Ye(r.commentDraft,o)||(r.commentDraft=o),y(o)}),a(),s(49,"button",35),b("click",function(){w(e);let o=_();return y(o.addComment())}),c(50,"Post"),a()()()(),S(51,"app-diff-viewer",36),a()(),Se()}if(i&2){let e=n.ngIf,t=_();l(4),h(e.shortHash),l(2),f("ngForOf",e.tags),l(),f("ngForOf",e.branches),l(),f("ngIf",e.isMerge),l(2),h(e.subject),l(3),Me("",e.author," <",e.authorEmail,">"),l(4),h(pe(18,29,e.date,"medium")),l(2),f("ngIf",e.body),l(2),f("disabled",t.explaining()),l(),T(" ",t.explaining()?"...":"\u2728 Explain change"," "),l(),f("disabled",t.loadingImpact()),l(),T(" ",t.loadingImpact()?"...":t.impact()?"Refresh impact":"Show impact"," "),l(2),T(" ",t.shareCopied()?"Copied!":"\u{1F517} Share"," "),l(),f("ngIf",t.explanation()),l(),f("ngIf",t.explainError()),l(),f("ngIf",t.impact()),l(6),f("ngIf",t.files().length),l(2),f("ngForOf",t.files())("ngForTrackBy",t.trackByFile),l(),f("ngIf",!t.files().length&&!t.loading()),l(),f("ngIf",t.loading()),l(2),f("open",t.annotationsOpen()),l(2),T(" \u{1F4AC} Notes (",t.comments().length,") "),l(2),f("ngForOf",t.comments()),l(2),Ze("ngModel",t.commentAuthor),l(),Ze("ngModel",t.commentDraft),l(),f("disabled",!t.commentDraft.trim()),l(2),f("fileInput",t.activeFile())}}function Pn(i,n){i&1&&(s(0,"div",74)(1,"p",75),c(2,"No commit selected"),a(),s(3,"p",76),c(4," Pick a commit from the list, or press "),s(5,"kbd",77),c(6,"\u2318K"),a(),c(7," to open the command palette. "),a()())}var ke=class i{state=p(N);git=p(Ut);insightsApi=p(Zt);annotationsApi=p(De);router=p(At);commit=this.state.selected;impact=C(null);loadingImpact=C(!1);explanation=C(null);explainError=C(null);explaining=C(!1);comments=C([]);annotationsOpen=C(!1);shareCopied=C(!1);commentDraft="";commentAuthor="me";loading=C(!1);files=$t(Wt(this.commit).pipe(Ce(n=>n?(this.loading.set(!0),this.git.getDiff(n.hash).pipe(ct(()=>j([])))):(this.loading.set(!1),j([])))),{initialValue:[]});activeFileIndex=C(0);activeFile=q(()=>{let n=this.files();if(!n.length)return null;let e=Math.min(this.activeFileIndex(),n.length-1);return n[e]});constructor(){F(()=>{this.files(),this.activeFileIndex.set(0),this.loading.set(!1)}),F(()=>{let n=this.commit();if(this.impact.set(null),this.explanation.set(null),this.explainError.set(null),this.shareCopied.set(!1),!n){this.comments.set([]);return}this.annotationsApi.list(n.hash).subscribe({next:e=>this.comments.set(e),error:()=>this.comments.set([])})})}trackByFile(n,e){return e.file}selectFile(n){let e=this.files().findIndex(t=>t.file===n.file);e>=0&&this.activeFileIndex.set(e)}openFileHistory(n){this.router.navigate(["/file",encodeURIComponent(n)])}shortPath(n){if(n.length<=32)return n;let e=n.split("/");return e.length<=2?n:e[0]+"/.../"+e.slice(-2).join("/")}onLoadImpact(){let n=this.commit();n&&(this.loadingImpact.set(!0),this.insightsApi.impact(n.hash).subscribe({next:e=>{this.impact.set(e),this.loadingImpact.set(!1)},error:()=>this.loadingImpact.set(!1)}))}onExplain(){let n=this.commit();!n||this.explaining()||(this.explaining.set(!0),this.explainError.set(null),this.insightsApi.explainCommit(n.hash).subscribe({next:e=>{this.explanation.set(e.summary),this.explaining.set(!1)},error:e=>{this.explainError.set(e?.error?.error??"AI explanation unavailable. Set ANTHROPIC_API_KEY or OPENAI_API_KEY."),this.explaining.set(!1)}}))}copyShareLink(){let n=this.commit();if(!n)return;let e=`${window.location.origin}/?commit=${n.hash}`;navigator.clipboard?.writeText(e).then(()=>{this.shareCopied.set(!0),setTimeout(()=>this.shareCopied.set(!1),1500)}).catch(()=>{this.shareCopied.set(!1)})}toggleAnnotations(n){setTimeout(()=>this.annotationsOpen.set(!this.annotationsOpen()),0)}addComment(){let n=this.commit();!n||!this.commentDraft.trim()||this.annotationsApi.add(n.hash,this.commentAuthor||"anonymous",this.commentDraft.trim()).subscribe({next:e=>{this.comments.set([...this.comments(),e]),this.commentDraft=""}})}deleteComment(n){let e=this.commit();e&&this.annotationsApi.remove(e.hash,n).subscribe({next:()=>this.comments.set(this.comments().filter(t=>t.id!==n))})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-commit-detail"]],decls:3,vars:2,consts:[["empty",""],["noRipple",""],[4,"ngIf","ngIfElse"],[1,"head"],[1,"row"],[1,"hash"],[1,"badges"],["class","badge tag",4,"ngFor","ngForOf"],["class","badge branch",4,"ngFor","ngForOf"],["class","badge merge",4,"ngIf"],[1,"subject"],[1,"meta"],[1,"dot"],["class","body",4,"ngIf"],[1,"actions"],[1,"btn","btn-ghost","btn-sm",3,"click","disabled"],[1,"btn","btn-ghost","btn-sm",3,"click"],["class","ai-card",4,"ngIf"],["class","ai-card error",4,"ngIf"],["class","impact-card",4,"ngIf"],[1,"split"],[1,"files"],[1,"files-header"],["class","count",4,"ngIf"],[1,"files-list"],["class","file-row",4,"ngFor","ngForOf","ngForTrackBy"],["class","files-empty",4,"ngIf"],[1,"diff"],[1,"annotations",3,"open"],[3,"click"],[1,"annot-body"],["class","comment",4,"ngFor","ngForOf"],[1,"comment-form"],["placeholder","Your name",1,"input",3,"ngModelChange","ngModel"],["placeholder","Add a note for your team\u2026",1,"input",3,"ngModelChange","ngModel"],[1,"btn",3,"click","disabled"],[3,"fileInput"],[1,"badge","tag"],[1,"badge","branch"],[1,"badge","merge"],[1,"body"],[1,"ai-card"],[1,"ai-pill"],[1,"ai-text"],[1,"btn","btn-ghost","btn-icon","close",3,"click"],[1,"ai-card","error"],[1,"impact-card"],[1,"impact-head"],[1,"impact-meta"],[1,"impact-body"],[1,"modules"],[4,"ngFor","ngForOf"],["class","ripple",4,"ngIf","ngIfElse"],[1,"related"],[3,"click",4,"ngFor","ngForOf"],[1,"ripple"],[1,"muted"],[1,"count"],[1,"file-row"],[1,"file",3,"click"],[1,"status-dot"],[1,"path",3,"title"],[1,"counts"],["class","add",4,"ngIf"],["class","del",4,"ngIf"],["title","View file history",1,"file-history",3,"click"],[1,"add"],[1,"del"],[1,"files-empty"],[1,"comment"],[1,"comment-head"],[1,"comment-date"],["title","Delete",1,"btn","btn-ghost","btn-icon",3,"click"],[1,"comment-body"],[1,"placeholder"],[1,"title"],[1,"hint"],[1,"kbd"]],template:function(e,t){if(e&1&&v(0,kn,52,32,"ng-container",2)(1,Pn,8,0,"ng-template",null,0,fe),e&2){let o=ce(2);f("ngIf",t.commit())("ngIfElse",o)}},dependencies:[z,H,V,Gt,Bt,jt,Ht,Yt,Ee],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:0;background:var(--bg-app)}.head[_ngcontent-%COMP%]{padding:.85rem 1rem;border-bottom:1px solid var(--border-soft);background:var(--bg-surface)}.row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin-bottom:.4rem}.hash[_ngcontent-%COMP%]{font-family:var(--font-mono);font-size:12px;color:var(--fg-muted);padding:2px 6px;background:var(--bg-surface-2);border:1px solid var(--border-soft);border-radius:4px}.badges[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:4px}.badge[_ngcontent-%COMP%]{font-size:10px;font-weight:600;padding:2px 6px;border-radius:999px}.badge.tag[_ngcontent-%COMP%]{background:#d9770626;color:var(--warning)}.badge.branch[_ngcontent-%COMP%]{background:var(--accent-soft);color:var(--accent)}.badge.merge[_ngcontent-%COMP%]{background:#8b5cf62e;color:#8b5cf6}.subject[_ngcontent-%COMP%]{font-size:18px;margin:0 0 4px;font-weight:600}.meta[_ngcontent-%COMP%]{display:flex;gap:6px;align-items:center;font-size:12px;color:var(--fg-muted)}.meta[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{opacity:.5}.body[_ngcontent-%COMP%]{white-space:pre-wrap;font-family:var(--font-mono);font-size:12px;color:var(--fg-secondary);background:var(--bg-surface-2);border:1px solid var(--border-soft);border-radius:var(--radius-sm);padding:.5rem .75rem;margin-top:.5rem;max-height:160px;overflow:auto}.split[_ngcontent-%COMP%]{flex:1;display:grid;grid-template-columns:280px 1fr;grid-template-rows:minmax(0,1fr);min-height:0;overflow:hidden}.files[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:0;background:var(--bg-surface);border-right:1px solid var(--border-soft)}.files-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding:.5rem .85rem;font-size:12px;color:var(--fg-muted);border-bottom:1px solid var(--border-soft)}.count[_ngcontent-%COMP%]{background:var(--bg-surface-2);padding:0 6px;border-radius:999px;font-size:11px}.files-list[_ngcontent-%COMP%]{overflow:auto;flex:1;min-height:0}.file[_ngcontent-%COMP%]{display:grid;grid-template-columns:10px 1fr auto;gap:.5rem;align-items:center;width:100%;padding:.5rem .85rem;border:0;background:transparent;color:inherit;cursor:pointer;text-align:left;border-bottom:1px solid var(--border-soft);font-size:12px}.file[_ngcontent-%COMP%]:hover{background:var(--bg-hover)}.file.selected[_ngcontent-%COMP%]{background:var(--bg-selected)}.file[_ngcontent-%COMP%] .path[_ngcontent-%COMP%]{font-family:var(--font-mono);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;direction:rtl;text-align:left}.status-dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;background:var(--accent)}.status-dot[data-status=added][_ngcontent-%COMP%]{background:var(--success)}.status-dot[data-status=deleted][_ngcontent-%COMP%]{background:var(--danger)}.status-dot[data-status=renamed][_ngcontent-%COMP%], .status-dot[data-status=copied][_ngcontent-%COMP%]{background:var(--warning)}.status-dot[data-status=binary][_ngcontent-%COMP%]{background:var(--fg-muted)}.counts[_ngcontent-%COMP%]{display:flex;gap:6px;font-family:var(--font-mono);font-size:11px}.counts[_ngcontent-%COMP%] .add[_ngcontent-%COMP%]{color:var(--success)}.counts[_ngcontent-%COMP%] .del[_ngcontent-%COMP%]{color:var(--danger)}.files-empty[_ngcontent-%COMP%]{padding:1rem;color:var(--fg-muted);font-size:12px;text-align:center}.diff[_ngcontent-%COMP%]{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}.placeholder[_ngcontent-%COMP%]{flex:1;display:grid;place-items:center;text-align:center;color:var(--fg-muted)}.placeholder[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:16px;margin-bottom:4px;color:var(--fg-secondary)}.placeholder[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{font-size:13px}.actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.6rem}.btn-sm[_ngcontent-%COMP%]{font-size:11px;padding:.3rem .65rem}.ai-card[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem;padding:.55rem .75rem;margin-top:.5rem;background:color-mix(in oklab,var(--accent) 12%,transparent);border-radius:var(--radius-sm);font-size:12px;color:var(--fg-secondary)}.ai-card.error[_ngcontent-%COMP%]{background:#ef44441f;color:var(--danger)}.ai-pill[_ngcontent-%COMP%]{flex-shrink:0;font-size:10px;font-weight:700;letter-spacing:.04em;background:var(--accent);color:var(--accent-fg);padding:1px 5px;border-radius:4px}.ai-text[_ngcontent-%COMP%]{flex:1;line-height:1.5}.ai-card[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{font-size:14px;line-height:1;padding:0 6px}.impact-card[_ngcontent-%COMP%]{margin:.6rem 1rem;background:var(--bg-surface);border:1px solid var(--border-soft);border-radius:var(--radius-md);padding:.75rem 1rem}.impact-head[_ngcontent-%COMP%]{display:flex;justify-content:space-between;font-weight:600;margin-bottom:.5rem;font-size:13px}.impact-meta[_ngcontent-%COMP%]{color:var(--fg-muted);font-weight:400;font-size:11px}.impact-body[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:.75rem;font-size:12px}.impact-body[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0 0 .4rem;font-size:11px;color:var(--fg-muted);text-transform:uppercase;letter-spacing:.04em}.impact-body[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0}.impact-body[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{padding:2px 0;word-break:break-all}.modules[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{font-family:var(--font-mono, monospace)}.ripple[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{font-size:11px;color:var(--fg-secondary)}.related[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{cursor:pointer;display:flex;gap:.4rem}.related[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:hover{color:var(--accent)}.related[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:var(--font-mono, monospace);color:var(--fg-muted);flex-shrink:0}.impact-body[_ngcontent-%COMP%] .muted[_ngcontent-%COMP%]{color:var(--fg-muted);font-style:italic;margin:0;font-size:11px}.file-row[_ngcontent-%COMP%]{display:flex}.file-row[_ngcontent-%COMP%] .file[_ngcontent-%COMP%]{flex:1}.file-history[_ngcontent-%COMP%]{background:transparent;border:0;border-bottom:1px solid var(--border-soft);cursor:pointer;color:var(--fg-muted);padding:0 .6rem;font-size:12px}.file-history[_ngcontent-%COMP%]:hover{background:var(--bg-elevated);color:var(--accent)}.annotations[_ngcontent-%COMP%]{margin:.5rem;background:var(--bg-surface);border:1px solid var(--border-soft);border-radius:var(--radius-sm)}.annotations[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]{padding:.4rem .7rem;cursor:pointer;font-size:12px;color:var(--fg-secondary);-webkit-user-select:none;user-select:none}.annotations[open][_ngcontent-%COMP%] summary[_ngcontent-%COMP%]{border-bottom:1px solid var(--border-soft)}.annot-body[_ngcontent-%COMP%]{padding:.5rem .7rem}.comment[_ngcontent-%COMP%]{padding:.4rem 0;border-bottom:1px dashed var(--border-soft);font-size:12px}.comment[_ngcontent-%COMP%]:last-of-type{border-bottom:0}.comment-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.comment-date[_ngcontent-%COMP%]{color:var(--fg-muted);font-size:11px;flex:1}.comment-body[_ngcontent-%COMP%]{margin:.2rem 0 0;line-height:1.4;white-space:pre-wrap}.comment-form[_ngcontent-%COMP%]{display:flex;gap:.4rem;flex-direction:column;margin-top:.5rem}.comment-form[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{width:100%;padding:.35rem .5rem;background:var(--bg-app);border:1px solid var(--border-soft);border-radius:var(--radius-sm);color:var(--fg-primary);font-family:inherit;font-size:12px}.comment-form[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{min-height:60px;resize:vertical}.comment-form[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{align-self:flex-end}"],changeDetection:0})};var In=["canvas"],Rn=["scroll"];function Tn(i,n){if(i&1&&S(0,"span",10),i&2){let e=n.$implicit;K("background",e)}}function Fn(i,n){i&1&&(s(0,"div",11),c(1," No commits to draw. "),a())}var B=34,ge=24,Re=5.5,qe=16,Te=16,Qe=["#4f46e5","#06b6d4","#f59e0b","#ef4444","#10b981","#8b5cf6","#ec4899","#0ea5e9"],Fe=class i{state=p(N);theme=p(Kt);legendColors=Qe.slice(0,5);graphSummary=q(()=>{let n=this.state.commits().length,e=this.laneCount;return n?`${n.toLocaleString()} commits across ${e} lane${e===1?"":"s"}`:"Swim-lane visualization"});canvasRef;scrollRef;nodes=[];rowByHash=new Map;laneCount=1;hoverRow=-1;onCanvasClick=n=>this.onClick(n);onCanvasMove=n=>this.onMouseMove(n);onCanvasLeave=()=>this.onMouseLeave();constructor(){F(()=>{this.layout(this.state.commits()),this.draw()}),F(()=>{this.state.selectedHash(),this.theme.resolved(),this.draw()})}ngAfterViewInit(){let n=this.canvasRef.nativeElement;n.addEventListener("click",this.onCanvasClick),n.addEventListener("mousemove",this.onCanvasMove),n.addEventListener("mouseleave",this.onCanvasLeave),this.draw()}ngOnDestroy(){let n=this.canvasRef?.nativeElement;n?.removeEventListener("click",this.onCanvasClick),n?.removeEventListener("mousemove",this.onCanvasMove),n?.removeEventListener("mouseleave",this.onCanvasLeave)}onResize(){this.draw()}layout(n){if(this.nodes=[],this.rowByHash.clear(),this.hoverRow=-1,!n.length){this.laneCount=1;return}let e=[],t=o=>{let r=e.indexOf(o);if(r>=0)return r;let m=e.indexOf(null);return m>=0?(e[m]=o,m):(e.push(o),e.length-1)};for(let o=0;o<n.length;o++){let r=n[o],m=t(r.hash),g={commit:r,row:o,lane:m};this.nodes.push(g),this.rowByHash.set(r.hash,g);let[d,...u]=r.parents;e[m]=d??null;for(let M of u)if(e.indexOf(M)===-1){let R=e.indexOf(null);R>=0?e[R]=M:e.push(M)}for(;e.length&&e[e.length-1]===null;)e.pop()}this.laneCount=Math.max(1,this.nodes.reduce((o,r)=>Math.max(o,r.lane+1),0))}draw(){let n=this.canvasRef?.nativeElement;if(!n)return;let e=this.scrollRef?.nativeElement,t=window.devicePixelRatio||1,o=qe*2+this.laneCount*ge,r=Te*2+Math.max(this.nodes.length,1)*B,m=Math.max(o,e?.clientWidth??o),g=Math.max(r,e?.clientHeight??r);n.width=Math.floor(m*t),n.height=Math.floor(g*t),n.style.width=`${m}px`,n.style.height=`${g}px`;let d=n.getContext("2d"),u=this.readTheme(n);if(d.setTransform(t,0,0,t,0,0),d.clearRect(0,0,m,g),d.fillStyle=u.surface,d.fillRect(0,0,m,g),!this.nodes.length)return;let M=x=>qe+x*ge+ge/2,R=x=>Te+x*B+B/2,it=x=>Qe[x%Qe.length],X=this.state.selectedHash();this.drawRows(d,m,M,R,u,X),this.drawGuides(d,R,u),d.lineCap="round",d.lineJoin="round";for(let x of this.nodes)for(let J of x.commit.parents){let A=this.rowByHash.get(J);if(!A)continue;let U=M(x.lane),G=R(x.row),ee=M(A.lane),Z=R(A.row);d.strokeStyle=u.shadow,d.lineWidth=4,d.globalAlpha=.35,this.drawEdge(d,U,G,ee,Z),d.strokeStyle=it(A.lane),d.lineWidth=x.commit.isMerge?2.6:2.2,d.globalAlpha=X&&X!==x.commit.hash&&X!==A.commit.hash?.55:.9,this.drawEdge(d,U,G,ee,Z),d.globalAlpha=1}for(let x of this.nodes){let J=M(x.lane),A=R(x.row),U=it(x.lane),G=x.commit.hash===X,ee=x.row===this.hoverRow,Z=G?Re+2:ee?Re+1:Re;d.beginPath(),d.arc(J,A,Z+3,0,Math.PI*2),d.fillStyle=u.nodeRing,d.fill(),d.beginPath(),d.arc(J,A,Z,0,Math.PI*2),d.fillStyle=x.commit.isMerge?u.surface:U,d.fill(),d.lineWidth=x.commit.isMerge||G?2.5:1.75,d.strokeStyle=U,d.stroke(),(G||ee)&&(d.beginPath(),d.arc(J,A,Z+5,0,Math.PI*2),d.strokeStyle=U,d.globalAlpha=G?.42:.24,d.lineWidth=2,d.stroke(),d.globalAlpha=1)}}drawRows(n,e,t,o,r,m){for(let g of this.nodes){let d=o(g.row)-B/2;if(g.row%2===1&&(n.fillStyle=r.rowAlt,n.fillRect(0,d,e,B)),(g.row===this.hoverRow||g.commit.hash===m)&&(n.fillStyle=g.commit.hash===m?r.rowSelected:r.rowHover,this.roundRect(n,6,d+3,e-12,B-6,8),n.fill()),g.commit.branches.length||g.commit.tags.length){let u=t(g.lane)+Re+8;this.drawRefPill(n,u,o(g.row),g.commit,r)}}}drawGuides(n,e,t){n.save(),n.strokeStyle=t.guide,n.lineWidth=1,n.setLineDash([3,5]);for(let o=0;o<this.laneCount;o++){let r=qe+o*ge+ge/2;n.beginPath(),n.moveTo(r,Te/2),n.lineTo(r,e(this.nodes.length-1)+B/2),n.stroke()}n.restore()}drawEdge(n,e,t,o,r){if(n.beginPath(),n.moveTo(e,t),e===o)n.lineTo(o,r);else{let m=t+Math.min(B*.75,Math.max(12,(r-t)*.36));n.bezierCurveTo(e,m,o,m,o,r)}n.stroke()}drawRefPill(n,e,t,o,r){let m=o.tags[0]??o.branches[0];if(!m)return;let g=m.length>16?`${m.slice(0,15)}...`:m;n.font="600 10px ui-sans-serif, system-ui, sans-serif";let d=Math.min(96,n.measureText(g).width+14),u=18;n.fillStyle=o.tags.length?r.warningSoft:r.accentSoft,this.roundRect(n,e,t-u/2,d,u,999),n.fill(),n.fillStyle=o.tags.length?r.warning:r.accent,n.fillText(g,e+7,t+3.5)}onClick(n){let e=this.nodeFromEvent(n);e&&this.state.selectHash(e.commit.hash)}onMouseMove(n){let e=this.nodeFromEvent(n),t=e?.row??-1;t!==this.hoverRow&&(this.hoverRow=t,this.canvasRef.nativeElement.style.cursor=e?"pointer":"default",this.draw())}onMouseLeave(){this.hoverRow!==-1&&(this.hoverRow=-1,this.canvasRef.nativeElement.style.cursor="default",this.draw())}nodeFromEvent(n){let e=this.canvasRef.nativeElement.getBoundingClientRect(),t=n.clientY-e.top,o=Math.floor((t-Te)/B);return this.nodes[o]}readTheme(n){let e=getComputedStyle(n);return{accent:this.css(e,"--accent","#4f46e5"),accentSoft:this.css(e,"--accent-soft","#eef2ff"),guide:this.css(e,"--graph-guide","rgba(148, 163, 184, 0.28)"),nodeRing:this.css(e,"--graph-node-ring","#ffffff"),rowAlt:this.css(e,"--graph-row-alt","rgba(15, 23, 42, 0.025)"),rowHover:this.css(e,"--graph-row-hover","rgba(79, 70, 229, 0.08)"),rowSelected:this.css(e,"--graph-row-selected","rgba(79, 70, 229, 0.14)"),shadow:this.css(e,"--graph-shadow","rgba(15, 23, 42, 0.12)"),surface:this.css(e,"--bg-surface","#ffffff"),warning:this.css(e,"--warning","#d97706"),warningSoft:"rgba(217, 119, 6, 0.15)"}}css(n,e,t){return n.getPropertyValue(e).trim()||t}roundRect(n,e,t,o,r,m){let g=Math.min(m,o/2,r/2);n.beginPath(),n.moveTo(e+g,t),n.arcTo(e+o,t,e+o,t+r,g),n.arcTo(e+o,t+r,e,t+r,g),n.arcTo(e,t+r,e,t,g),n.arcTo(e,t,e+o,t,g),n.closePath()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-commit-graph"]],viewQuery:function(e,t){if(e&1&&(ae(In,7),ae(Rn,7)),e&2){let o;se(o=le())&&(t.canvasRef=o.first),se(o=le())&&(t.scrollRef=o.first)}},hostBindings:function(e,t){e&1&&b("resize",function(){return t.onResize()},we)},decls:13,vars:3,consts:[["scroll",""],["canvas",""],[1,"header"],[1,"title"],[1,"hint"],["aria-hidden","true",1,"legend"],["class","swatch",3,"background",4,"ngFor","ngForOf"],[1,"scroll"],["aria-label","Commit graph","role","img"],["class","empty",4,"ngIf"],[1,"swatch"],[1,"empty"]],template:function(e,t){e&1&&(s(0,"div",2)(1,"div",3)(2,"span"),c(3,"Graph"),a(),s(4,"span",4),c(5),a()(),s(6,"div",5),v(7,Tn,1,2,"span",6),a()(),s(8,"div",7,0),S(10,"canvas",8,1),v(12,Fn,2,0,"div",9),a()),e&2&&(l(5),h(t.graphSummary()),l(2),f("ngForOf",t.legendColors),l(5),f("ngIf",!t.state.commits().length&&!t.state.loading()))},dependencies:[z,H,V],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:0;background:var(--bg-surface);border-right:1px solid var(--border-soft)}.header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.6rem .85rem;border-bottom:1px solid var(--border-soft);font-size:12px;color:var(--fg-muted);background:color-mix(in oklab,var(--bg-surface) 96%,var(--bg-surface-2))}.title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1px;min-width:0}.title[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:first-child{color:var(--fg-primary);font-size:13px;font-weight:600}.hint[_ngcontent-%COMP%]{white-space:nowrap}.legend[_ngcontent-%COMP%]{display:flex;gap:4px;align-items:center;flex:0 0 auto}.swatch[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:999px;box-shadow:0 0 0 2px var(--bg-surface)}.scroll[_ngcontent-%COMP%]{position:relative;flex:1;overflow:auto;min-height:0;background:radial-gradient(circle at 24px 24px,var(--graph-row-alt) 0 1px,transparent 1px 100%),var(--bg-surface);background-size:24px 24px}canvas[_ngcontent-%COMP%]{display:block}.empty[_ngcontent-%COMP%]{position:absolute;inset:0;display:grid;place-items:center;padding:1rem;color:var(--fg-muted);font-size:12px;text-align:center}"],changeDetection:0})};function he(i,n=0){return Vn(i)?Number(i):arguments.length===2?n:0}function Vn(i){return!isNaN(parseFloat(i))&&!isNaN(Number(i))}function qt(i){return i instanceof ne?i.nativeElement:i}var Xe;try{Xe=typeof Intl<"u"&&Intl.v8BreakIterator}catch{Xe=!1}var Ve=(()=>{class i{_platformId=p(Ct);isBrowser=this._platformId?Nt(this._platformId):typeof document=="object"&&!!document;EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent);TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent);BLINK=this.isBrowser&&!!(window.chrome||Xe)&&typeof CSS<"u"&&!this.EDGE&&!this.TRIDENT;WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT;IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window);FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent);ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT;SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT;constructor(){}static \u0275fac=function(t){return new(t||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var zn=new W("cdk-dir-doc",{providedIn:"root",factory:Nn});function Nn(){return p(be)}var Ln=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;function An(i){let n=i?.toLowerCase()||"";return n==="auto"&&typeof navigator<"u"&&navigator?.language?Ln.test(navigator.language)?"rtl":"ltr":n==="rtl"?"rtl":"ltr"}var Qt=(()=>{class i{get value(){return this.valueSignal()}valueSignal=C("ltr");change=new yt;constructor(){let e=p(zn,{optional:!0});if(e){let t=e.body?e.body.dir:null,o=e.documentElement?e.documentElement.dir:null;this.valueSignal.set(An(t||o||"ltr"))}}ngOnDestroy(){this.change.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var I=(function(i){return i[i.NORMAL=0]="NORMAL",i[i.NEGATED=1]="NEGATED",i[i.INVERTED=2]="INVERTED",i})(I||{}),ze,$;function Xt(){if($==null){if(typeof document!="object"||!document||typeof Element!="function"||!Element)return $=!1,$;if(document.documentElement?.style&&"scrollBehavior"in document.documentElement.style)$=!0;else{let i=Element.prototype.scrollTo;i?$=!/\{\s*\[native code\]\s*\}/.test(i.toString()):$=!1}}return $}function Q(){if(typeof document!="object"||!document)return I.NORMAL;if(ze==null){let i=document.createElement("div"),n=i.style;i.dir="rtl",n.width="1px",n.overflow="auto",n.visibility="hidden",n.pointerEvents="none",n.position="absolute";let e=document.createElement("div"),t=e.style;t.width="2px",t.height="1px",i.appendChild(e),document.body.appendChild(i),ze=I.NORMAL,i.scrollLeft===0&&(i.scrollLeft=1,ze=i.scrollLeft===0?I.NEGATED:I.INVERTED),i.remove()}return ze}var Je=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=ie({type:i});static \u0275inj=te({})}return i})();var Ne=class{};function Jt(i){return i&&typeof i.connect=="function"&&!(i instanceof rt)}var Le=class extends Ne{_data;constructor(n){super(),this._data=n}connect(){return _e(this._data)?this._data:j(this._data)}disconnect(){}},ue=(function(i){return i[i.REPLACED=0]="REPLACED",i[i.INSERTED=1]="INSERTED",i[i.MOVED=2]="MOVED",i[i.REMOVED=3]="REMOVED",i})(ue||{}),et=new W("_ViewRepeater"),Ae=class{viewCacheSize=20;_viewCache=[];applyChanges(n,e,t,o,r){n.forEachOperation((m,g,d)=>{let u,M;if(m.previousIndex==null){let R=()=>t(m,g,d);u=this._insertView(R,d,e,o(m)),M=u?ue.INSERTED:ue.REPLACED}else d==null?(this._detachAndCacheView(g,e),M=ue.REMOVED):(u=this._moveView(g,d,e,o(m)),M=ue.MOVED);r&&r({context:u?.context,operation:M,record:m})})}detach(){for(let n of this._viewCache)n.destroy();this._viewCache=[]}_insertView(n,e,t,o){let r=this._insertViewFromCache(e,t);if(r){r.context.$implicit=o;return}let m=n();return t.createEmbeddedView(m.templateRef,m.context,m.index)}_detachAndCacheView(n,e){let t=e.detach(n);this._maybeCacheView(t,e)}_moveView(n,e,t,o){let r=t.get(n);return t.move(r,e),r.context.$implicit=o,r}_maybeCacheView(n,e){if(this._viewCache.length<this.viewCacheSize)this._viewCache.push(n);else{let t=e.indexOf(n);t===-1?n.destroy():e.remove(t)}}_insertViewFromCache(n,e){let t=this._viewCache.pop();return t&&e.insert(t,n),t||null}};var Bn=["contentWrapper"],jn=["*"],on=new W("VIRTUAL_SCROLL_STRATEGY"),tt=class{_scrolledIndexChange=new O;scrolledIndexChange=this._scrolledIndexChange.pipe(dt());_viewport=null;_itemSize;_minBufferPx;_maxBufferPx;constructor(n,e,t){this._itemSize=n,this._minBufferPx=e,this._maxBufferPx=t}attach(n){this._viewport=n,this._updateTotalContentSize(),this._updateRenderedRange()}detach(){this._scrolledIndexChange.complete(),this._viewport=null}updateItemAndBufferSize(n,e,t){t<e,this._itemSize=n,this._minBufferPx=e,this._maxBufferPx=t,this._updateTotalContentSize(),this._updateRenderedRange()}onContentScrolled(){this._updateRenderedRange()}onDataLengthChanged(){this._updateTotalContentSize(),this._updateRenderedRange()}onContentRendered(){}onRenderedOffsetChanged(){}scrollToIndex(n,e){this._viewport&&this._viewport.scrollToOffset(n*this._itemSize,e)}_updateTotalContentSize(){this._viewport&&this._viewport.setTotalContentSize(this._viewport.getDataLength()*this._itemSize)}_updateRenderedRange(){if(!this._viewport)return;let n=this._viewport.getRenderedRange(),e={start:n.start,end:n.end},t=this._viewport.getViewportSize(),o=this._viewport.getDataLength(),r=this._viewport.measureScrollOffset(),m=this._itemSize>0?r/this._itemSize:0;if(e.end>o){let d=Math.ceil(t/this._itemSize),u=Math.max(0,Math.min(m,o-d));m!=u&&(m=u,r=u*this._itemSize,e.start=Math.floor(m)),e.end=Math.max(0,Math.min(o,e.start+d))}let g=r-e.start*this._itemSize;if(g<this._minBufferPx&&e.start!=0){let d=Math.ceil((this._maxBufferPx-g)/this._itemSize);e.start=Math.max(0,e.start-d),e.end=Math.min(o,Math.ceil(m+(t+this._minBufferPx)/this._itemSize))}else{let d=e.end*this._itemSize-(r+t);if(d<this._minBufferPx&&e.end!=o){let u=Math.ceil((this._maxBufferPx-d)/this._itemSize);u>0&&(e.end=Math.min(o,e.end+u),e.start=Math.max(0,Math.floor(m-this._minBufferPx/this._itemSize)))}}this._viewport.setRenderedRange(e),this._viewport.setRenderedContentOffset(Math.round(this._itemSize*e.start)),this._scrolledIndexChange.next(Math.floor(m))}};function Hn(i){return i._scrollStrategy}var rn=(()=>{class i{get itemSize(){return this._itemSize}set itemSize(e){this._itemSize=he(e)}_itemSize=20;get minBufferPx(){return this._minBufferPx}set minBufferPx(e){this._minBufferPx=he(e)}_minBufferPx=100;get maxBufferPx(){return this._maxBufferPx}set maxBufferPx(e){this._maxBufferPx=he(e)}_maxBufferPx=200;_scrollStrategy=new tt(this.itemSize,this.minBufferPx,this.maxBufferPx);ngOnChanges(){this._scrollStrategy.updateItemAndBufferSize(this.itemSize,this.minBufferPx,this.maxBufferPx)}static \u0275fac=function(t){return new(t||i)};static \u0275dir=Y({type:i,selectors:[["cdk-virtual-scroll-viewport","itemSize",""]],inputs:{itemSize:"itemSize",minBufferPx:"minBufferPx",maxBufferPx:"maxBufferPx"},features:[de([{provide:on,useFactory:Hn,deps:[ft(()=>i)]}]),vt]})}return i})(),Gn=20,Wn=(()=>{class i{_ngZone=p(oe);_platform=p(Ve);_renderer=p($e).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new O;_scrolledCount=0;scrollContainers=new Map;register(e){this.scrollContainers.has(e)||this.scrollContainers.set(e,e.elementScrolled().subscribe(()=>this._scrolled.next(e)))}deregister(e){let t=this.scrollContainers.get(e);t&&(t.unsubscribe(),this.scrollContainers.delete(e))}scrolled(e=Gn){return this._platform.isBrowser?new Ge(t=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let o=e>0?this._scrolled.pipe(ve(e)).subscribe(t):this._scrolled.subscribe(t);return this._scrolledCount++,()=>{o.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):j()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((e,t)=>this.deregister(t)),this._scrolled.complete()}ancestorScrolled(e,t){let o=this.getAncestorScrollContainers(e);return this.scrolled(t).pipe(lt(r=>!r||o.indexOf(r)>-1))}getAncestorScrollContainers(e){let t=[];return this.scrollContainers.forEach((o,r)=>{this._scrollableContainsElement(r,e)&&t.push(r)}),t}_scrollableContainsElement(e,t){let o=qt(t),r=e.getElementRef().nativeElement;do if(o==r)return!0;while(o=o.parentElement);return!1}static \u0275fac=function(t){return new(t||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),an=(()=>{class i{elementRef=p(ne);scrollDispatcher=p(Wn);ngZone=p(oe);dir=p(Qt,{optional:!0});_scrollElement=this.elementRef.nativeElement;_destroyed=new O;_renderer=p(bt);_cleanupScroll;_elementScrolled=new O;constructor(){}ngOnInit(){this._cleanupScroll=this.ngZone.runOutsideAngular(()=>this._renderer.listen(this._scrollElement,"scroll",e=>this._elementScrolled.next(e))),this.scrollDispatcher.register(this)}ngOnDestroy(){this._cleanupScroll?.(),this._elementScrolled.complete(),this.scrollDispatcher.deregister(this),this._destroyed.next(),this._destroyed.complete()}elementScrolled(){return this._elementScrolled}getElementRef(){return this.elementRef}scrollTo(e){let t=this.elementRef.nativeElement,o=this.dir&&this.dir.value=="rtl";e.left==null&&(e.left=o?e.end:e.start),e.right==null&&(e.right=o?e.start:e.end),e.bottom!=null&&(e.top=t.scrollHeight-t.clientHeight-e.bottom),o&&Q()!=I.NORMAL?(e.left!=null&&(e.right=t.scrollWidth-t.clientWidth-e.left),Q()==I.INVERTED?e.left=e.right:Q()==I.NEGATED&&(e.left=e.right?-e.right:e.right)):e.right!=null&&(e.left=t.scrollWidth-t.clientWidth-e.right),this._applyScrollToOptions(e)}_applyScrollToOptions(e){let t=this.elementRef.nativeElement;Xt()?t.scrollTo(e):(e.top!=null&&(t.scrollTop=e.top),e.left!=null&&(t.scrollLeft=e.left))}measureScrollOffset(e){let t="left",o="right",r=this.elementRef.nativeElement;if(e=="top")return r.scrollTop;if(e=="bottom")return r.scrollHeight-r.clientHeight-r.scrollTop;let m=this.dir&&this.dir.value=="rtl";return e=="start"?e=m?o:t:e=="end"&&(e=m?t:o),m&&Q()==I.INVERTED?e==t?r.scrollWidth-r.clientWidth-r.scrollLeft:r.scrollLeft:m&&Q()==I.NEGATED?e==t?r.scrollLeft+r.scrollWidth-r.clientWidth:-r.scrollLeft:e==t?r.scrollLeft:r.scrollWidth-r.clientWidth-r.scrollLeft}static \u0275fac=function(t){return new(t||i)};static \u0275dir=Y({type:i,selectors:[["","cdk-scrollable",""],["","cdkScrollable",""]]})}return i})(),$n=20,Un=(()=>{class i{_platform=p(Ve);_listeners;_viewportSize;_change=new O;_document=p(be);constructor(){let e=p(oe),t=p($e).createRenderer(null,null);e.runOutsideAngular(()=>{if(this._platform.isBrowser){let o=r=>this._change.next(r);this._listeners=[t.listen("window","resize",o),t.listen("window","orientationchange",o)]}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){this._listeners?.forEach(e=>e()),this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}getViewportRect(){let e=this.getViewportScrollPosition(),{width:t,height:o}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+o,right:e.left+t,height:o,width:t}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,t=this._getWindow(),o=e.documentElement,r=o.getBoundingClientRect(),m=-r.top||e.body.scrollTop||t.scrollY||o.scrollTop||0,g=-r.left||e.body.scrollLeft||t.scrollX||o.scrollLeft||0;return{top:m,left:g}}change(e=$n){return e>0?this._change.pipe(ve(e)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}static \u0275fac=function(t){return new(t||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),en=new W("VIRTUAL_SCROLLABLE"),Zn=(()=>{class i extends an{constructor(){super()}measureViewportSize(e){let t=this.elementRef.nativeElement;return e==="horizontal"?t.clientWidth:t.clientHeight}static \u0275fac=function(t){return new(t||i)};static \u0275dir=Y({type:i,features:[Ue]})}return i})();function Yn(i,n){return i.start==n.start&&i.end==n.end}var Kn=typeof requestAnimationFrame<"u"?st:at,nt=(()=>{class i extends Zn{elementRef=p(ne);_changeDetectorRef=p(Ft);_scrollStrategy=p(on,{optional:!0});scrollable=p(en,{optional:!0});_platform=p(Ve);_detachedSubject=new O;_renderedRangeSubject=new O;get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this._calculateSpacerSize())}_orientation="vertical";appendOnly=!1;scrolledIndexChange=new Ge(e=>this._scrollStrategy.scrolledIndexChange.subscribe(t=>Promise.resolve().then(()=>this.ngZone.run(()=>e.next(t)))));_contentWrapper;renderedRangeStream=this._renderedRangeSubject;_totalContentSize=0;_totalContentWidth=C("");_totalContentHeight=C("");_renderedContentTransform;_renderedRange={start:0,end:0};_dataLength=0;_viewportSize=0;_forOf;_renderedContentOffset=0;_renderedContentOffsetNeedsRewrite=!1;_changeDetectionNeeded=C(!1);_runAfterChangeDetection=[];_viewportChanges=ot.EMPTY;_injector=p(gt);_isDestroyed=!1;constructor(){super();let e=p(Un);this._scrollStrategy,this._viewportChanges=e.change().subscribe(()=>{this.checkViewportSize()}),this.scrollable||(this.elementRef.nativeElement.classList.add("cdk-virtual-scrollable"),this.scrollable=this);let t=F(()=>{this._changeDetectionNeeded()&&this._doChangeDetection()},{injector:p(Mt).injector});p(ht).onDestroy(()=>void t.destroy())}ngOnInit(){this._platform.isBrowser&&(this.scrollable===this&&super.ngOnInit(),this.ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>{this._measureViewportSize(),this._scrollStrategy.attach(this),this.scrollable.elementScrolled().pipe(We(null),ve(0,Kn),xe(this._destroyed)).subscribe(()=>this._scrollStrategy.onContentScrolled()),this._markChangeDetectionNeeded()})))}ngOnDestroy(){this.detach(),this._scrollStrategy.detach(),this._renderedRangeSubject.complete(),this._detachedSubject.complete(),this._viewportChanges.unsubscribe(),this._isDestroyed=!0,super.ngOnDestroy()}attach(e){this._forOf,this.ngZone.runOutsideAngular(()=>{this._forOf=e,this._forOf.dataStream.pipe(xe(this._detachedSubject)).subscribe(t=>{let o=t.length;o!==this._dataLength&&(this._dataLength=o,this._scrollStrategy.onDataLengthChanged()),this._doChangeDetection()})})}detach(){this._forOf=null,this._detachedSubject.next()}getDataLength(){return this._dataLength}getViewportSize(){return this._viewportSize}getRenderedRange(){return this._renderedRange}measureBoundingClientRectWithScrollOffset(e){return this.getElementRef().nativeElement.getBoundingClientRect()[e]}setTotalContentSize(e){this._totalContentSize!==e&&(this._totalContentSize=e,this._calculateSpacerSize(),this._markChangeDetectionNeeded())}setRenderedRange(e){Yn(this._renderedRange,e)||(this.appendOnly&&(e={start:0,end:Math.max(this._renderedRange.end,e.end)}),this._renderedRangeSubject.next(this._renderedRange=e),this._markChangeDetectionNeeded(()=>this._scrollStrategy.onContentRendered()))}getOffsetToRenderedContentStart(){return this._renderedContentOffsetNeedsRewrite?null:this._renderedContentOffset}setRenderedContentOffset(e,t="to-start"){e=this.appendOnly&&t==="to-start"?0:e;let o=this.dir&&this.dir.value=="rtl",r=this.orientation=="horizontal",m=r?"X":"Y",d=`translate${m}(${Number((r&&o?-1:1)*e)}px)`;this._renderedContentOffset=e,t==="to-end"&&(d+=` translate${m}(-100%)`,this._renderedContentOffsetNeedsRewrite=!0),this._renderedContentTransform!=d&&(this._renderedContentTransform=d,this._markChangeDetectionNeeded(()=>{this._renderedContentOffsetNeedsRewrite?(this._renderedContentOffset-=this.measureRenderedContentSize(),this._renderedContentOffsetNeedsRewrite=!1,this.setRenderedContentOffset(this._renderedContentOffset)):this._scrollStrategy.onRenderedOffsetChanged()}))}scrollToOffset(e,t="auto"){let o={behavior:t};this.orientation==="horizontal"?o.start=e:o.top=e,this.scrollable.scrollTo(o)}scrollToIndex(e,t="auto"){this._scrollStrategy.scrollToIndex(e,t)}measureScrollOffset(e){let t;return this.scrollable==this?t=o=>super.measureScrollOffset(o):t=o=>this.scrollable.measureScrollOffset(o),Math.max(0,t(e??(this.orientation==="horizontal"?"start":"top"))-this.measureViewportOffset())}measureViewportOffset(e){let t,o="left",r="right",m=this.dir?.value=="rtl";e=="start"?t=m?r:o:e=="end"?t=m?o:r:e?t=e:t=this.orientation==="horizontal"?"left":"top";let g=this.scrollable.measureBoundingClientRectWithScrollOffset(t);return this.elementRef.nativeElement.getBoundingClientRect()[t]-g}measureRenderedContentSize(){let e=this._contentWrapper.nativeElement;return this.orientation==="horizontal"?e.offsetWidth:e.offsetHeight}measureRangeSize(e){return this._forOf?this._forOf.measureRangeSize(e,this.orientation):0}checkViewportSize(){this._measureViewportSize(),this._scrollStrategy.onDataLengthChanged()}_measureViewportSize(){this._viewportSize=this.scrollable.measureViewportSize(this.orientation)}_markChangeDetectionNeeded(e){e&&this._runAfterChangeDetection.push(e),!Tt(this._changeDetectionNeeded)&&this.ngZone.runOutsideAngular(()=>{Promise.resolve().then(()=>{this.ngZone.run(()=>{this._changeDetectionNeeded.set(!0)})})})}_doChangeDetection(){this._isDestroyed||this.ngZone.run(()=>{this._changeDetectorRef.markForCheck(),this._contentWrapper.nativeElement.style.transform=this._renderedContentTransform,St(()=>{this._changeDetectionNeeded.set(!1);let e=this._runAfterChangeDetection;this._runAfterChangeDetection=[];for(let t of e)t()},{injector:this._injector})})}_calculateSpacerSize(){this._totalContentHeight.set(this.orientation==="horizontal"?"":`${this._totalContentSize}px`),this._totalContentWidth.set(this.orientation==="horizontal"?`${this._totalContentSize}px`:"")}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=E({type:i,selectors:[["cdk-virtual-scroll-viewport"]],viewQuery:function(t,o){if(t&1&&ae(Bn,7),t&2){let r;se(r=le())&&(o._contentWrapper=r.first)}},hostAttrs:[1,"cdk-virtual-scroll-viewport"],hostVars:4,hostBindings:function(t,o){t&2&&P("cdk-virtual-scroll-orientation-horizontal",o.orientation==="horizontal")("cdk-virtual-scroll-orientation-vertical",o.orientation!=="horizontal")},inputs:{orientation:"orientation",appendOnly:[2,"appendOnly","appendOnly",zt]},outputs:{scrolledIndexChange:"scrolledIndexChange"},features:[de([{provide:an,useFactory:(e,t)=>e||t,deps:[[new _t,new ut(en)],i]}]),Ue],ngContentSelectors:jn,decls:4,vars:4,consts:[["contentWrapper",""],[1,"cdk-virtual-scroll-content-wrapper"],[1,"cdk-virtual-scroll-spacer"]],template:function(t,o){t&1&&(kt(),Et(0,"div",1,0),Pt(2),Ot(),Dt(3,"div",2)),t&2&&(l(3),K("width",o._totalContentWidth())("height",o._totalContentHeight()))},styles:[`cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}
|
|
2
|
-
`],encapsulation:2,changeDetection:0})}return i})();function tn(i,n,e){let t=e;if(!t.getBoundingClientRect)return 0;let o=t.getBoundingClientRect();return i==="horizontal"?n==="start"?o.left:o.right:n==="start"?o.top:o.bottom}var sn=(()=>{class i{_viewContainerRef=p(wt);_template=p(xt);_differs=p(Vt);_viewRepeater=p(et);_viewport=p(nt,{skipSelf:!0});viewChange=new O;_dataSourceChanges=new O;get cdkVirtualForOf(){return this._cdkVirtualForOf}set cdkVirtualForOf(e){this._cdkVirtualForOf=e,Jt(e)?this._dataSourceChanges.next(e):this._dataSourceChanges.next(new Le(_e(e)?e:Array.from(e||[])))}_cdkVirtualForOf;get cdkVirtualForTrackBy(){return this._cdkVirtualForTrackBy}set cdkVirtualForTrackBy(e){this._needsUpdate=!0,this._cdkVirtualForTrackBy=e?(t,o)=>e(t+(this._renderedRange?this._renderedRange.start:0),o):void 0}_cdkVirtualForTrackBy;set cdkVirtualForTemplate(e){e&&(this._needsUpdate=!0,this._template=e)}get cdkVirtualForTemplateCacheSize(){return this._viewRepeater.viewCacheSize}set cdkVirtualForTemplateCacheSize(e){this._viewRepeater.viewCacheSize=he(e)}dataStream=this._dataSourceChanges.pipe(We(null),mt(),Ce(([e,t])=>this._changeDataSource(e,t)),pt(1));_differ=null;_data;_renderedItems;_renderedRange;_needsUpdate=!1;_destroyed=new O;constructor(){let e=p(oe);this.dataStream.subscribe(t=>{this._data=t,this._onRenderedDataChange()}),this._viewport.renderedRangeStream.pipe(xe(this._destroyed)).subscribe(t=>{this._renderedRange=t,this.viewChange.observers.length&&e.run(()=>this.viewChange.next(this._renderedRange)),this._onRenderedDataChange()}),this._viewport.attach(this)}measureRangeSize(e,t){if(e.start>=e.end)return 0;e.start<this._renderedRange.start||e.end>this._renderedRange.end;let o=e.start-this._renderedRange.start,r=e.end-e.start,m,g;for(let d=0;d<r;d++){let u=this._viewContainerRef.get(d+o);if(u&&u.rootNodes.length){m=g=u.rootNodes[0];break}}for(let d=r-1;d>-1;d--){let u=this._viewContainerRef.get(d+o);if(u&&u.rootNodes.length){g=u.rootNodes[u.rootNodes.length-1];break}}return m&&g?tn(t,"end",g)-tn(t,"start",m):0}ngDoCheck(){if(this._differ&&this._needsUpdate){let e=this._differ.diff(this._renderedItems);e?this._applyChanges(e):this._updateContext(),this._needsUpdate=!1}}ngOnDestroy(){this._viewport.detach(),this._dataSourceChanges.next(void 0),this._dataSourceChanges.complete(),this.viewChange.complete(),this._destroyed.next(),this._destroyed.complete(),this._viewRepeater.detach()}_onRenderedDataChange(){this._renderedRange&&(this._renderedItems=this._data.slice(this._renderedRange.start,this._renderedRange.end),this._differ||(this._differ=this._differs.find(this._renderedItems).create((e,t)=>this.cdkVirtualForTrackBy?this.cdkVirtualForTrackBy(e,t):t)),this._needsUpdate=!0)}_changeDataSource(e,t){return e&&e.disconnect(this),this._needsUpdate=!0,t?t.connect(this):j()}_updateContext(){let e=this._data.length,t=this._viewContainerRef.length;for(;t--;){let o=this._viewContainerRef.get(t);o.context.index=this._renderedRange.start+t,o.context.count=e,this._updateComputedContextProperties(o.context),o.detectChanges()}}_applyChanges(e){this._viewRepeater.applyChanges(e,this._viewContainerRef,(r,m,g)=>this._getEmbeddedViewArgs(r,g),r=>r.item),e.forEachIdentityChange(r=>{let m=this._viewContainerRef.get(r.currentIndex);m.context.$implicit=r.item});let t=this._data.length,o=this._viewContainerRef.length;for(;o--;){let r=this._viewContainerRef.get(o);r.context.index=this._renderedRange.start+o,r.context.count=t,this._updateComputedContextProperties(r.context)}}_updateComputedContextProperties(e){e.first=e.index===0,e.last=e.index===e.count-1,e.even=e.index%2===0,e.odd=!e.even}_getEmbeddedViewArgs(e,t){return{templateRef:this._template,context:{$implicit:e.item,cdkVirtualForOf:this._cdkVirtualForOf,index:-1,count:-1,first:!1,last:!1,odd:!1,even:!1},index:t}}static ngTemplateContextGuard(e,t){return!0}static \u0275fac=function(t){return new(t||i)};static \u0275dir=Y({type:i,selectors:[["","cdkVirtualFor","","cdkVirtualForOf",""]],inputs:{cdkVirtualForOf:"cdkVirtualForOf",cdkVirtualForTrackBy:"cdkVirtualForTrackBy",cdkVirtualForTemplate:"cdkVirtualForTemplate",cdkVirtualForTemplateCacheSize:"cdkVirtualForTemplateCacheSize"},features:[de([{provide:et,useClass:Ae}])]})}return i})();var nn=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=ie({type:i});static \u0275inj=te({})}return i})(),ln=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=ie({type:i});static \u0275inj=te({imports:[Je,nn,Je,nn]})}return i})();function Qn(i,n){i&1&&S(0,"span",19)}function Xn(i,n){if(i&1&&(s(0,"span",23),c(1),a()),i&2){let e=n.$implicit;l(),h(e)}}function Jn(i,n){if(i&1&&(s(0,"span",24),c(1),a()),i&2){let e=n.$implicit;l(),h(e)}}function ei(i,n){if(i&1&&(s(0,"span",20),v(1,Xn,2,1,"span",21)(2,Jn,2,1,"span",22),a()),i&2){let e=_().$implicit;l(),f("ngForOf",e.tags),l(),f("ngForOf",e.branches)}}function ti(i,n){if(i&1){let e=k();s(0,"button",7),b("click",function(){let o=w(e).$implicit,r=_();return y(r.select(o))}),s(1,"span",8),S(2,"span",9),v(3,Qn,1,0,"span",10),a(),s(4,"span",11)(5,"span",12),c(6),a(),s(7,"span",13)(8,"span",14),c(9),a(),s(10,"span",15),c(11,"\u2022"),a(),s(12,"span",16),c(13),a(),s(14,"span",15),c(15,"\u2022"),a(),s(16,"span",17),c(17),me(18,"date"),a()()(),v(19,ei,3,2,"span",18),a()}if(i&2){let e=n.$implicit,t=n.index,o=_();P("selected",e.hash===o.selectedHash()),re("aria-current",e.hash===o.selectedHash()?"true":null),l(2),K("background",o.laneColor(e)),P("merge",e.isMerge),l(),f("ngIf",t<o.commits().length-1),l(2),f("title",e.subject),l(),h(e.subject),l(3),h(e.shortHash),l(4),h(e.author),l(4),h(pe(18,14,e.date,"MMM d, y, h:mm a")),l(2),f("ngIf",e.branches.length||e.tags.length)}}function ni(i,n){i&1&&(s(0,"div",25)(1,"p"),c(2,"No commits match your filters."),a()())}var Be=class i{state=p(N);commits=this.state.commits;selectedHash=this.state.selectedHash;trackByHash(n,e){return e.hash}select(n){this.state.selectHash(n.hash)}laneColors=["#4f46e5","#06b6d4","#f59e0b","#ef4444","#10b981","#8b5cf6"];laneColor(n){let e=0,t=n.branches[0]??n.parents[0]??n.hash;for(let o=0;o<t.length;o++)e=e*31+t.charCodeAt(o)>>>0;return this.laneColors[e%this.laneColors.length]}onKey(n){if(!this.isTyping(n.target)){if(n.key==="j")n.preventDefault(),this.state.selectByOffset(1);else if(n.key==="k")n.preventDefault(),this.state.selectByOffset(-1);else if(n.key==="g"){n.preventDefault();let e=this.state.commits();e.length&&this.state.selectHash(e[0].hash)}else if(n.key==="G"){n.preventDefault();let e=this.state.commits();e.length&&this.state.selectHash(e[e.length-1].hash)}}}isTyping(n){return n instanceof HTMLElement?["INPUT","TEXTAREA","SELECT"].includes(n.tagName)||n.isContentEditable:!1}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-commit-list"]],hostBindings:function(e,t){e&1&&b("keydown",function(r){return t.onKey(r)},we)},decls:13,vars:6,consts:[[1,"header"],[1,"count"],[1,"hint"],[1,"kbd"],["minBufferPx","640","maxBufferPx","1280",1,"viewport",3,"itemSize"],["class","row",3,"selected","click",4,"cdkVirtualFor","cdkVirtualForOf","cdkVirtualForTrackBy"],["class","empty",4,"ngIf"],[1,"row",3,"click"],[1,"lane"],[1,"dot"],["class","line",4,"ngIf"],[1,"content"],[1,"subject",3,"title"],[1,"meta"],[1,"hash"],[1,"dot-sep"],[1,"author"],[1,"date"],["class","badges",4,"ngIf"],[1,"line"],[1,"badges"],["class","badge tag",4,"ngFor","ngForOf"],["class","badge branch",4,"ngFor","ngForOf"],[1,"badge","tag"],[1,"badge","branch"],[1,"empty"]],template:function(e,t){e&1&&(s(0,"div",0)(1,"span",1),c(2),a(),s(3,"span",2)(4,"kbd",3),c(5,"j"),a(),c(6,"/"),s(7,"kbd",3),c(8,"k"),a(),c(9," navigate "),a()(),s(10,"cdk-virtual-scroll-viewport",4),v(11,ti,20,17,"button",5)(12,ni,3,0,"div",6),a()),e&2&&(l(2),Me("",t.commits().length," of ",t.state.total()),l(8),f("itemSize",64),l(),f("cdkVirtualForOf",t.commits())("cdkVirtualForTrackBy",t.trackByHash),l(),f("ngIf",!t.commits().length&&!t.state.loading()))},dependencies:[z,H,V,ln,rn,sn,nt,Ee],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:0;background:var(--bg-surface);border-right:1px solid var(--border-soft)}.header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:.5rem .85rem;border-bottom:1px solid var(--border-soft);font-size:12px;color:var(--fg-muted);background:var(--bg-surface)}.viewport[_ngcontent-%COMP%]{flex:1;min-height:0}.row[_ngcontent-%COMP%]{display:grid;grid-template-columns:24px 1fr auto;gap:.5rem;align-items:center;width:100%;height:64px;padding:.45rem .85rem;background:transparent;border:0;border-bottom:1px solid var(--border-soft);color:inherit;text-align:left;cursor:pointer;transition:background .1s}.row[_ngcontent-%COMP%]:hover{background:var(--bg-hover)}.row.selected[_ngcontent-%COMP%]{background:var(--bg-selected)}.row.selected[_ngcontent-%COMP%] .subject[_ngcontent-%COMP%]{color:var(--fg-primary)}.lane[_ngcontent-%COMP%]{position:relative;width:24px;height:100%;display:flex;align-items:center;justify-content:center}.dot[_ngcontent-%COMP%]{width:10px;height:10px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 2px var(--bg-surface);z-index:1}.dot.merge[_ngcontent-%COMP%]{background:transparent;border:2px solid var(--accent)}.line[_ngcontent-%COMP%]{position:absolute;top:50%;left:50%;width:2px;height:50%;background:var(--border-strong);transform:translate(-50%)}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0;gap:2px}.subject[_ngcontent-%COMP%]{font-weight:500;color:var(--fg-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.meta[_ngcontent-%COMP%]{display:flex;gap:6px;font-size:11px;color:var(--fg-muted);align-items:center}.hash[_ngcontent-%COMP%]{font-family:var(--font-mono)}.dot-sep[_ngcontent-%COMP%]{opacity:.5}.badges[_ngcontent-%COMP%]{display:flex;gap:4px;flex-wrap:wrap}.badge[_ngcontent-%COMP%]{font-size:10px;font-weight:600;padding:2px 6px;border-radius:999px;letter-spacing:.02em}.badge.tag[_ngcontent-%COMP%]{background:#d9770626;color:var(--warning)}.badge.branch[_ngcontent-%COMP%]{background:var(--accent-soft);color:var(--accent)}.empty[_ngcontent-%COMP%]{padding:2rem 1rem;text-align:center;color:var(--fg-muted)}"],changeDetection:0})};var je=class i{http=p(Oe);base="/api";list(n={}){let e=new Lt;for(let[t,o]of Object.entries(n))o&&(e=e.set(t,String(o)));return this.http.get(`${this.base}/groups`,{params:e})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};function ii(i,n){if(i&1&&(s(0,"span",7),c(1),a()),i&2){let e=n.ngIf;l(),T("",e," groups")}}function oi(i,n){i&1&&(s(0,"div",8),c(1,"Loading groups\u2026"),a())}function ri(i,n){if(i&1&&(s(0,"div",9),c(1),a()),i&2){let e=n.ngIf;l(),h(e)}}function ai(i,n){i&1&&(s(0,"div",8),c(1," No groups detected. Try the flat view. "),a())}function si(i,n){if(i&1&&(s(0,"span",18),c(1),a()),i&2){let e=_().$implicit;l(),T("#",e.prNumber)}}function li(i,n){if(i&1){let e=k();s(0,"li",21),b("click",function(){let o=w(e).$implicit,r=_(3);return y(r.state.selectHash(o))}),s(1,"code",22),c(2),a(),s(3,"span",23),c(4),a()()}if(i&2){let e=n.$implicit,t=_(3);P("selected",e===t.state.selectedHash()),l(2),h(t.shortHash(e)),l(2),h(t.subjectFor(e))}}function ci(i,n){if(i&1&&(s(0,"ul",19),v(1,li,5,4,"li",20),a()),i&2){let e=_().$implicit;l(),f("ngForOf",e.commits)}}function di(i,n){if(i&1){let e=k();s(0,"li",10)(1,"button",11),b("click",function(){let o=w(e).$implicit,r=_();return y(r.toggle(o.id))}),s(2,"span",12),c(3,"\u25B8"),a(),s(4,"span",13),c(5),a(),v(6,si,2,1,"span",14),s(7,"span",15),c(8),a(),s(9,"span",16),c(10),a()(),v(11,ci,2,1,"ul",17),a()}if(i&2){let e=n.$implicit,t=_();P("expanded",t.isExpanded(e.id)),l(2),P("open",t.isExpanded(e.id)),l(2),It("src-"+e.source),l(),h(t.sourceLabel(e.source)),l(),f("ngIf",e.prNumber),l(2),h(e.title),l(2),h(e.commits.length),l(),f("ngIf",t.isExpanded(e.id))}}var He=class i{state=p(N);groupsApi=p(je);groups=C(null);loading=C(!1);error=C(null);expanded=C(new Set);subjectMap=q(()=>{let n=new Map;for(let e of this.state.commits())n.set(e.hash,e.subject);return n});constructor(){F(()=>{let n=this.state.filters();this.load(n.since,n.until,n.author)})}isExpanded(n){return this.expanded().has(n)}toggle(n){let e=new Set(this.expanded());e.has(n)?e.delete(n):e.add(n),this.expanded.set(e)}shortHash(n){return n.slice(0,7)}subjectFor(n){return this.subjectMap().get(n)??n.slice(0,7)}sourceLabel(n){switch(n){case"merge":return"PR";case"squash":return"PR (sq)";case"conventional":return"Feat";case"standalone":return"commit"}}load(n,e,t){this.loading.set(!0),this.error.set(null),this.groupsApi.list({since:n,until:e,author:t}).subscribe({next:o=>{this.groups.set(o),this.loading.set(!1);let r=o.find(m=>m.prNumber);r&&this.expanded.set(new Set([r.id]))},error:o=>{this.error.set(this.errMsg(o)),this.loading.set(!1)}})}errMsg(n){if(n&&typeof n=="object"&&"error"in n){let e=n.error;if(e?.error)return e.error}return n instanceof Error?n.message:"Failed to load groups"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-grouped-list"]],decls:9,vars:5,consts:[[1,"head"],[1,"title"],["class","meta",4,"ngIf"],["class","empty",4,"ngIf"],["class","empty error",4,"ngIf"],[1,"groups"],["class","group",3,"expanded",4,"ngFor","ngForOf"],[1,"meta"],[1,"empty"],[1,"empty","error"],[1,"group"],[1,"group-head",3,"click"],[1,"caret"],[1,"badge"],["class","pr",4,"ngIf"],[1,"g-title"],[1,"count"],["class","commits",4,"ngIf"],[1,"pr"],[1,"commits"],["class","commit",3,"selected","click",4,"ngFor","ngForOf"],[1,"commit",3,"click"],[1,"hash"],[1,"subject"]],template:function(e,t){if(e&1&&(s(0,"div",0)(1,"span",1),c(2,"PR / feature groups"),a(),v(3,ii,2,1,"span",2),a(),v(4,oi,2,0,"div",3)(5,ri,2,1,"div",4)(6,ai,2,0,"div",3),s(7,"ul",5),v(8,di,12,11,"li",6),a()),e&2){let o,r;l(3),f("ngIf",(o=t.groups())==null?null:o.length),l(),f("ngIf",t.loading()),l(),f("ngIf",t.error()),l(),f("ngIf",!t.loading()&&!t.error()&&(((r=t.groups())==null?null:r.length)??0)===0),l(2),f("ngForOf",t.groups())}},dependencies:[z,H,V],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden}.head[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding:.6rem .85rem;border-bottom:1px solid var(--border-soft);background:var(--bg-surface)}.title[_ngcontent-%COMP%]{font-weight:600;font-size:13px}.meta[_ngcontent-%COMP%]{font-size:11px;color:var(--fg-muted)}.empty[_ngcontent-%COMP%]{padding:1rem .85rem;color:var(--fg-muted);font-size:12px}.empty.error[_ngcontent-%COMP%]{color:var(--danger)}.groups[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;overflow-y:auto;flex:1}.group[_ngcontent-%COMP%]{border-bottom:1px solid var(--border-soft)}.group-head[_ngcontent-%COMP%]{width:100%;display:flex;align-items:center;gap:.5rem;padding:.55rem .85rem;background:transparent;border:0;color:var(--fg-primary);cursor:pointer;text-align:left}.group-head[_ngcontent-%COMP%]:hover{background:var(--bg-elevated)}.caret[_ngcontent-%COMP%]{display:inline-block;width:10px;transition:transform .15s ease;color:var(--fg-muted)}.caret.open[_ngcontent-%COMP%]{transform:rotate(90deg)}.badge[_ngcontent-%COMP%]{font-size:10px;letter-spacing:.04em;padding:1px 6px;border-radius:3px;background:var(--bg-elevated);color:var(--fg-secondary);text-transform:uppercase}.badge.src-merge[_ngcontent-%COMP%]{background:#6366f12e;color:var(--accent)}.badge.src-squash[_ngcontent-%COMP%]{background:#10b9812e;color:#10b981}.badge.src-conventional[_ngcontent-%COMP%]{background:#f59e0b2e;color:#d97706}.pr[_ngcontent-%COMP%]{font-size:11px;color:var(--fg-muted)}.g-title[_ngcontent-%COMP%]{flex:1;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.count[_ngcontent-%COMP%]{font-size:11px;color:var(--fg-muted);background:var(--bg-elevated);padding:1px 6px;border-radius:999px}.commits[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0 0 .4rem;background:var(--bg-app)}.commit[_ngcontent-%COMP%]{display:flex;gap:.6rem;align-items:center;padding:.3rem .85rem .3rem 2rem;cursor:pointer;font-size:12px}.commit[_ngcontent-%COMP%]:hover{background:var(--bg-elevated)}.commit.selected[_ngcontent-%COMP%]{background:color-mix(in oklab,var(--accent) 20%,transparent)}.commit[_ngcontent-%COMP%] .hash[_ngcontent-%COMP%]{font-family:var(--font-mono, monospace);font-size:11px;color:var(--fg-muted)}.commit[_ngcontent-%COMP%] .subject[_ngcontent-%COMP%]{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"],changeDetection:0})};function mi(i,n){i&1&&(ye(0),S(1,"app-grouped-list"),Se())}function pi(i,n){i&1&&S(0,"app-commit-list")}var cn=class i{state=p(N);static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-home-shell"]],decls:9,vars:2,consts:[["flat",""],[1,"layout"],[1,"pane","graph"],[1,"pane","list"],[4,"ngIf","ngIfElse"],[1,"pane","detail"]],template:function(e,t){if(e&1&&(s(0,"main",1)(1,"aside",2),S(2,"app-commit-graph"),a(),s(3,"section",3),v(4,mi,2,0,"ng-container",4)(5,pi,1,0,"ng-template",null,0,fe),a(),s(7,"section",5),S(8,"app-commit-detail"),a()()),e&2){let o=ce(6);l(4),f("ngIf",t.state.viewMode()==="grouped")("ngIfElse",o)}},dependencies:[z,V,Fe,Be,ke,He],styles:["[_nghost-%COMP%]{display:block;flex:1;min-height:0}.layout[_ngcontent-%COMP%]{height:100%;display:grid;grid-template-columns:220px 380px 1fr;min-height:0}.pane[_ngcontent-%COMP%]{min-width:0;min-height:0;overflow:hidden}.pane.graph[_ngcontent-%COMP%]{border-right:1px solid var(--border-soft)}@media (max-width: 1100px){.layout[_ngcontent-%COMP%]{grid-template-columns:320px 1fr}.pane.graph[_ngcontent-%COMP%]{display:none}}@media (max-width: 720px){.layout[_ngcontent-%COMP%]{grid-template-columns:1fr}.pane.list[_ngcontent-%COMP%]{display:none}}"],changeDetection:0})};export{cn as HomeShellComponent};
|