@imenam/mcp-documentor 1.0.41 → 1.0.43
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/shared/schemas/doc.schema.d.ts +3 -0
- package/dist/shared/schemas/doc.schema.js +2 -1
- package/dist/src/core/section-tracker.d.ts +3 -1
- package/dist/src/core/section-tracker.js +30 -6
- package/dist/src/gui-worker.js +13 -3
- package/dist/src/tools/get-doc-metadata.js +1 -1
- package/dist/src/tools/refresh-file-snapshot.js +5 -1
- package/dist/src/tools/search-docs.js +5 -4
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/gui/dist/assets/_baseUniq-DZMSH6LY.js +1 -0
- package/gui/dist/assets/arc-d6vCj415.js +1 -0
- package/gui/dist/assets/architectureDiagram-Q4EWVU46-DpjCbxl8.js +36 -0
- package/gui/dist/assets/blockDiagram-DXYQGD6D-CZIaNHcg.js +132 -0
- package/gui/dist/assets/c4Diagram-AHTNJAMY-1msrJILA.js +10 -0
- package/gui/dist/assets/channel-BFrTrLvs.js +1 -0
- package/gui/dist/assets/chunk-4BX2VUAB-CkLF885e.js +1 -0
- package/gui/dist/assets/chunk-4TB4RGXK-D8CC2YNW.js +206 -0
- package/gui/dist/assets/chunk-55IACEB6-C7FEdpkb.js +1 -0
- package/gui/dist/assets/chunk-EDXVE4YY-C23agwGR.js +1 -0
- package/gui/dist/assets/chunk-FMBD7UC4-CEhsfI5h.js +15 -0
- package/gui/dist/assets/chunk-OYMX7WX6-ilR6wRCK.js +231 -0
- package/gui/dist/assets/chunk-QZHKN3VN-DdQZG0vY.js +1 -0
- package/gui/dist/assets/chunk-YZCP3GAM-CgmspmqH.js +1 -0
- package/gui/dist/assets/classDiagram-6PBFFD2Q-BZfAjuci.js +1 -0
- package/gui/dist/assets/classDiagram-v2-HSJHXN6E-BZfAjuci.js +1 -0
- package/gui/dist/assets/clone-yCXJEjsc.js +1 -0
- package/gui/dist/assets/cose-bilkent-S5V4N54A-56jCXyJj.js +1 -0
- package/gui/dist/assets/cytoscape.esm-DkOyvmE4.js +321 -0
- package/gui/dist/assets/dagre-KV5264BT-DGnxBfaO.js +4 -0
- package/gui/dist/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/gui/dist/assets/diagram-5BDNPKRD-DogE9xah.js +10 -0
- package/gui/dist/assets/diagram-G4DWMVQ6-DyZFSdHs.js +24 -0
- package/gui/dist/assets/diagram-MMDJMWI5-sWXZ6wCa.js +43 -0
- package/gui/dist/assets/diagram-TYMM5635-C7qkJ6-2.js +24 -0
- package/gui/dist/assets/erDiagram-SMLLAGMA-AhWYISUY.js +85 -0
- package/gui/dist/assets/flowDiagram-DWJPFMVM-Br8z3zk6.js +162 -0
- package/gui/dist/assets/ganttDiagram-T4ZO3ILL-CBCeivaB.js +292 -0
- package/gui/dist/assets/gitGraphDiagram-UUTBAWPF-Cnlj4QP0.js +106 -0
- package/gui/dist/assets/graph-Cjti22ih.js +1 -0
- package/gui/dist/assets/index-S_CEg9ug.css +1 -0
- package/gui/dist/assets/index-r9vO4oVD.js +355 -0
- package/gui/dist/assets/infoDiagram-42DDH7IO-5N3Oyg5b.js +2 -0
- package/gui/dist/assets/init-Gi6I4Gst.js +1 -0
- package/gui/dist/assets/ishikawaDiagram-UXIWVN3A-8hzonEtF.js +70 -0
- package/gui/dist/assets/journeyDiagram-VCZTEJTY-KRgQGKFH.js +139 -0
- package/gui/dist/assets/kanban-definition-6JOO6SKY-B8BnXjy5.js +89 -0
- package/gui/dist/assets/katex-DHMw6HUq.js +257 -0
- package/gui/dist/assets/layout-CeSYiiC6.js +1 -0
- package/gui/dist/assets/linear-GvfAFEU8.js +1 -0
- package/gui/dist/assets/min-CkKufs6A.js +1 -0
- package/gui/dist/assets/mindmap-definition-QFDTVHPH-DLavNUck.js +96 -0
- package/gui/dist/assets/ordinal-Cboi1Yqb.js +1 -0
- package/gui/dist/assets/pieDiagram-DEJITSTG-DHcucViZ.js +30 -0
- package/gui/dist/assets/quadrantDiagram-34T5L4WZ-DKJ9xm03.js +7 -0
- package/gui/dist/assets/requirementDiagram-MS252O5E-_HRD8DRs.js +84 -0
- package/gui/dist/assets/sankeyDiagram-XADWPNL6-BheI7uAI.js +10 -0
- package/gui/dist/assets/sequenceDiagram-FGHM5R23-DWW_pOkZ.js +157 -0
- package/gui/dist/assets/stateDiagram-FHFEXIEX-CMInyUmC.js +1 -0
- package/gui/dist/assets/stateDiagram-v2-QKLJ7IA2-Dueg5g0Q.js +1 -0
- package/gui/dist/assets/timeline-definition-GMOUNBTQ-843gDlOd.js +120 -0
- package/gui/dist/assets/vennDiagram-DHZGUBPP-36_WQJ2W.js +34 -0
- package/gui/dist/assets/wardley-RL74JXVD-DAuMNidq.js +162 -0
- package/gui/dist/assets/wardleyDiagram-NUSXRM2D-DPec4Dij.js +20 -0
- package/gui/dist/assets/xychartDiagram-5P7HB3ND-W-o516TZ.js +7 -0
- package/gui/dist/index.html +3 -3
- package/package.json +1 -1
- package/gui/dist/assets/index-CtH--sUk.js +0 -53
- package/gui/dist/assets/index-DWum7n8m.css +0 -1
|
@@ -5,6 +5,7 @@ export declare const TrackedSectionSchema: z.ZodObject<{
|
|
|
5
5
|
bottom: z.ZodArray<z.ZodString>;
|
|
6
6
|
}, z.core.$strip>;
|
|
7
7
|
sectionHash: z.ZodString;
|
|
8
|
+
lineCount: z.ZodOptional<z.ZodNumber>;
|
|
8
9
|
}, z.core.$strip>;
|
|
9
10
|
export type TrackedSection = z.infer<typeof TrackedSectionSchema>;
|
|
10
11
|
export declare const TrackedFileSchema: z.ZodObject<{
|
|
@@ -17,6 +18,7 @@ export declare const TrackedFileSchema: z.ZodObject<{
|
|
|
17
18
|
bottom: z.ZodArray<z.ZodString>;
|
|
18
19
|
}, z.core.$strip>;
|
|
19
20
|
sectionHash: z.ZodString;
|
|
21
|
+
lineCount: z.ZodOptional<z.ZodNumber>;
|
|
20
22
|
}, z.core.$strip>>>;
|
|
21
23
|
}, z.core.$strip>;
|
|
22
24
|
export type TrackedFile = z.infer<typeof TrackedFileSchema>;
|
|
@@ -46,6 +48,7 @@ export declare const DocSchema: z.ZodObject<{
|
|
|
46
48
|
bottom: z.ZodArray<z.ZodString>;
|
|
47
49
|
}, z.core.$strip>;
|
|
48
50
|
sectionHash: z.ZodString;
|
|
51
|
+
lineCount: z.ZodOptional<z.ZodNumber>;
|
|
49
52
|
}, z.core.$strip>>>;
|
|
50
53
|
}, z.core.$strip>>>;
|
|
51
54
|
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -5,6 +5,7 @@ export const TrackedSectionSchema = z.object({
|
|
|
5
5
|
bottom: z.array(z.string()),
|
|
6
6
|
}),
|
|
7
7
|
sectionHash: z.string(),
|
|
8
|
+
lineCount: z.number().optional(),
|
|
8
9
|
});
|
|
9
10
|
export const TrackedFileSchema = z.object({
|
|
10
11
|
path: z.string(),
|
|
@@ -75,7 +76,7 @@ export const SearchDocsArgsSchema = z.object({
|
|
|
75
76
|
});
|
|
76
77
|
export const RefreshFileSnapshotArgsSchema = z.object({
|
|
77
78
|
paths: z.array(z.string()).min(1).describe("Paths of documentation entries to refresh, e.g. ['backend/auth/authentication', 'setup']"),
|
|
78
|
-
file_paths: z.array(z.string()).optional().describe("Specific tracked file paths to refresh (refreshes all tracked files if omitted)"),
|
|
79
|
+
file_paths: z.array(z.string()).optional().describe("Specific tracked file paths to refresh, as absolute paths (refreshes all tracked files if omitted)"),
|
|
79
80
|
});
|
|
80
81
|
export const GetDocMetadataArgsSchema = z.object({
|
|
81
82
|
path: z.string().describe("Path of the documentation entry, e.g. 'backend/auth/authentication'"),
|
|
@@ -2,7 +2,9 @@ import type { TrackedSection } from "../../shared/schemas/doc.schema.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Reads a file and snapshots a section defined by 1-indexed [start, end] line numbers.
|
|
4
4
|
* Extracts top/bottom anchor lines and computes a hash of the section content.
|
|
5
|
-
* The `lines` input is intentionally not persisted — only anchors and
|
|
5
|
+
* The `lines` input is intentionally not persisted — only anchors, sectionHash, and lineCount are stored.
|
|
6
|
+
* `lineCount` is used by findAndHashSection to constrain the bottom anchor search and prevent
|
|
7
|
+
* false matches when the file contains repeated lines.
|
|
6
8
|
*/
|
|
7
9
|
export declare function snapshotSection(absolutePath: string, start: number, end: number): TrackedSection;
|
|
8
10
|
type FindResult = {
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import crypto from "crypto";
|
|
2
2
|
import fs from "fs";
|
|
3
3
|
const ANCHOR_SIZE = 3;
|
|
4
|
+
// Tolerance (in lines) around the expected bottom anchor position when lineCount is known.
|
|
5
|
+
const BOTTOM_ANCHOR_TOLERANCE = 10;
|
|
4
6
|
/**
|
|
5
7
|
* Reads a file and snapshots a section defined by 1-indexed [start, end] line numbers.
|
|
6
8
|
* Extracts top/bottom anchor lines and computes a hash of the section content.
|
|
7
|
-
* The `lines` input is intentionally not persisted — only anchors and
|
|
9
|
+
* The `lines` input is intentionally not persisted — only anchors, sectionHash, and lineCount are stored.
|
|
10
|
+
* `lineCount` is used by findAndHashSection to constrain the bottom anchor search and prevent
|
|
11
|
+
* false matches when the file contains repeated lines.
|
|
8
12
|
*/
|
|
9
13
|
export function snapshotSection(absolutePath, start, end) {
|
|
10
14
|
const fileContent = fs.readFileSync(absolutePath, "utf-8");
|
|
@@ -24,7 +28,7 @@ export function snapshotSection(absolutePath, start, end) {
|
|
|
24
28
|
bottom = sectionLines.slice(sectionLines.length - ANCHOR_SIZE);
|
|
25
29
|
}
|
|
26
30
|
const sectionHash = crypto.createHash("sha256").update(sectionLines.join("\n")).digest("hex");
|
|
27
|
-
return { anchors: { top, bottom }, sectionHash };
|
|
31
|
+
return { anchors: { top, bottom }, sectionHash, lineCount: sectionLines.length };
|
|
28
32
|
}
|
|
29
33
|
/**
|
|
30
34
|
* Locates a tracked section in the current file content using its stored anchors,
|
|
@@ -50,12 +54,23 @@ export function findAndHashSection(absolutePath, section) {
|
|
|
50
54
|
}
|
|
51
55
|
return { found: false };
|
|
52
56
|
}
|
|
53
|
-
// Normal path: locate top anchor, then search for bottom anchor below it
|
|
57
|
+
// Normal path: locate top anchor, then search for bottom anchor below it.
|
|
58
|
+
// If lineCount is stored, constrain the search window to prevent false matches on repeated lines.
|
|
54
59
|
for (let i = 0; i <= fileLines.length - top.length; i++) {
|
|
55
60
|
if (!top.every((line, j) => fileLines[i + j] === line))
|
|
56
61
|
continue;
|
|
57
62
|
const searchStart = i + top.length;
|
|
58
|
-
|
|
63
|
+
// Constrain bottom anchor search when lineCount is known
|
|
64
|
+
const expectedBottomStart = section.lineCount !== undefined
|
|
65
|
+
? i + section.lineCount - bottom.length
|
|
66
|
+
: undefined;
|
|
67
|
+
const kMin = expectedBottomStart !== undefined
|
|
68
|
+
? Math.max(searchStart, expectedBottomStart - BOTTOM_ANCHOR_TOLERANCE)
|
|
69
|
+
: searchStart;
|
|
70
|
+
const kMax = expectedBottomStart !== undefined
|
|
71
|
+
? Math.min(fileLines.length - bottom.length, expectedBottomStart + BOTTOM_ANCHOR_TOLERANCE)
|
|
72
|
+
: fileLines.length - bottom.length;
|
|
73
|
+
for (let k = kMin; k <= kMax; k++) {
|
|
59
74
|
if (!bottom.every((line, j) => fileLines[k + j] === line))
|
|
60
75
|
continue;
|
|
61
76
|
const sectionLines = fileLines.slice(i, k + bottom.length);
|
|
@@ -87,12 +102,21 @@ export function relocateAndRefreshSection(absolutePath, section) {
|
|
|
87
102
|
if (!top.every((line, j) => fileLines[i + j] === line))
|
|
88
103
|
continue;
|
|
89
104
|
const searchStart = i + top.length;
|
|
90
|
-
|
|
105
|
+
const expectedBottomStart = section.lineCount !== undefined
|
|
106
|
+
? i + section.lineCount - bottom.length
|
|
107
|
+
: undefined;
|
|
108
|
+
const kMin = expectedBottomStart !== undefined
|
|
109
|
+
? Math.max(searchStart, expectedBottomStart - BOTTOM_ANCHOR_TOLERANCE)
|
|
110
|
+
: searchStart;
|
|
111
|
+
const kMax = expectedBottomStart !== undefined
|
|
112
|
+
? Math.min(fileLines.length - bottom.length, expectedBottomStart + BOTTOM_ANCHOR_TOLERANCE)
|
|
113
|
+
: fileLines.length - bottom.length;
|
|
114
|
+
for (let k = kMin; k <= kMax; k++) {
|
|
91
115
|
if (!bottom.every((line, j) => fileLines[k + j] === line))
|
|
92
116
|
continue;
|
|
93
117
|
const sectionLines = fileLines.slice(i, k + bottom.length);
|
|
94
118
|
const sectionHash = crypto.createHash("sha256").update(sectionLines.join("\n")).digest("hex");
|
|
95
|
-
return { found: true, refreshed: { anchors: section.anchors, sectionHash } };
|
|
119
|
+
return { found: true, refreshed: { anchors: section.anchors, sectionHash, lineCount: sectionLines.length } };
|
|
96
120
|
}
|
|
97
121
|
}
|
|
98
122
|
return { found: false };
|
package/dist/src/gui-worker.js
CHANGED
|
@@ -25,6 +25,7 @@ const rootDir = findProjectRoot(__dirname);
|
|
|
25
25
|
const dataDir = process.env.MCP_DATA_DIR?.trim() || path.join(rootDir, ".docs-data");
|
|
26
26
|
const staticRoot = path.join(rootDir, "gui/dist");
|
|
27
27
|
const absoluteStaticRoot = path.resolve(staticRoot);
|
|
28
|
+
const configuredAppPath = process.env.APP_PATH || "/documentor-gui";
|
|
28
29
|
setupLogging({ processLabel: "mcp-documentor:GUI", logDir: path.join(rootDir, ".docs-data", "logs") });
|
|
29
30
|
const logger = createLogger("mcp-documentor:GUI");
|
|
30
31
|
process.on("uncaughtException", (err) => {
|
|
@@ -389,6 +390,7 @@ app.get("/api/export-zip/:id", async (c) => {
|
|
|
389
390
|
}
|
|
390
391
|
}
|
|
391
392
|
catch { /* use default */ }
|
|
393
|
+
const flat = c.req.query('flat') === '1';
|
|
392
394
|
const zip = new JSZip();
|
|
393
395
|
for (const ref of bundle.docs) {
|
|
394
396
|
let project;
|
|
@@ -415,7 +417,8 @@ app.get("/api/export-zip/:id", async (c) => {
|
|
|
415
417
|
content = `# [Read error: ${ref}]\n`;
|
|
416
418
|
}
|
|
417
419
|
}
|
|
418
|
-
|
|
420
|
+
const zipPath = flat ? `${docId.split('/').pop()}.md` : `${project}/${docId}.md`;
|
|
421
|
+
zip.file(zipPath, content);
|
|
419
422
|
}
|
|
420
423
|
const zipBuffer = await zip.generateAsync({ type: "nodebuffer" });
|
|
421
424
|
return new Response(new Uint8Array(zipBuffer), {
|
|
@@ -428,6 +431,10 @@ app.get("/api/export-zip/:id", async (c) => {
|
|
|
428
431
|
});
|
|
429
432
|
// Static files
|
|
430
433
|
app.use("/assets/*", serveStatic({ root: path.relative(process.cwd(), absoluteStaticRoot) }));
|
|
434
|
+
function getHtmlBaseHref(appPath) {
|
|
435
|
+
const normalized = appPath.startsWith("/") ? appPath : `/${appPath}`;
|
|
436
|
+
return normalized.endsWith("/") ? normalized : `${normalized}/`;
|
|
437
|
+
}
|
|
431
438
|
// SPA Fallback
|
|
432
439
|
app.get("/*", (c, next) => {
|
|
433
440
|
const urlPath = c.req.path;
|
|
@@ -437,7 +444,10 @@ app.get("/*", (c, next) => {
|
|
|
437
444
|
try {
|
|
438
445
|
const indexPath = path.join(absoluteStaticRoot, "index.html");
|
|
439
446
|
if (fs.existsSync(indexPath)) {
|
|
440
|
-
const
|
|
447
|
+
const baseHref = getHtmlBaseHref(configuredAppPath);
|
|
448
|
+
const html = fs
|
|
449
|
+
.readFileSync(indexPath, "utf8")
|
|
450
|
+
.replace("<head>", `<head>\n <base href="${baseHref}" />`);
|
|
441
451
|
return c.html(html);
|
|
442
452
|
}
|
|
443
453
|
return c.text("GUI Build not found at " + absoluteStaticRoot, 404);
|
|
@@ -452,7 +462,7 @@ async function startServer() {
|
|
|
452
462
|
process.exit(0);
|
|
453
463
|
}
|
|
454
464
|
const proxyUrl = process.env.PROXY_URL;
|
|
455
|
-
const appPath =
|
|
465
|
+
const appPath = configuredAppPath;
|
|
456
466
|
const appName = process.env.APP_NAME || "MCP Documentor GUI";
|
|
457
467
|
logger.info(`Starting server with proxyUrl=${proxyUrl}`);
|
|
458
468
|
proxyClient = new ProxyClient(proxyUrl);
|
|
@@ -26,7 +26,7 @@ export async function getDocMetadata(storageEngine, args) {
|
|
|
26
26
|
if (doc.tracked_files.length > 0) {
|
|
27
27
|
text += `\nTracked files (${doc.tracked_files.length} total):\n`;
|
|
28
28
|
text += doc.tracked_files.map((f) => {
|
|
29
|
-
let entry = ` ${fileStatusIcon(f.path)} — ${f.path}\n
|
|
29
|
+
let entry = ` ${fileStatusIcon(f.path)} — ${f.path}\n File mtime: ${f.lastModifiedAt}`;
|
|
30
30
|
if (f.sections && f.sections.length > 0) {
|
|
31
31
|
const sectionLines = f.sections.map((section, idx) => {
|
|
32
32
|
const result = findAndHashSection(f.path, section);
|
|
@@ -17,8 +17,12 @@ export async function refreshFileSnapshot(storageEngine, historyStore, args) {
|
|
|
17
17
|
const missing = [];
|
|
18
18
|
const skipped = [];
|
|
19
19
|
const anchorsLost = [];
|
|
20
|
+
// Normalize to forward slashes and lowercase for case-insensitive comparison on Windows
|
|
21
|
+
// (e.g. stored 'c:\...' vs provided 'C:\...'). file_paths must be absolute paths.
|
|
22
|
+
const norm = (p) => p.replace(/\\/g, "/").toLowerCase();
|
|
23
|
+
const resolvedFilePaths = validated.file_paths?.map(norm);
|
|
20
24
|
for (const tracked of doc.tracked_files) {
|
|
21
|
-
if (
|
|
25
|
+
if (resolvedFilePaths && !resolvedFilePaths.includes(norm(tracked.path))) {
|
|
22
26
|
skipped.push(tracked.path);
|
|
23
27
|
continue;
|
|
24
28
|
}
|
|
@@ -2,9 +2,9 @@ import { SearchDocsArgsSchema } from "../../shared/schemas/doc.schema.js";
|
|
|
2
2
|
export async function searchDocs(storageEngine, embeddingEngine, args) {
|
|
3
3
|
try {
|
|
4
4
|
const validated = SearchDocsArgsSchema.parse(args);
|
|
5
|
-
const
|
|
6
|
-
const results = await embeddingEngine.
|
|
7
|
-
const doc = await storageEngine.getDoc(
|
|
5
|
+
const config = storageEngine.getConfig();
|
|
6
|
+
const results = await embeddingEngine.searchAcrossProjects(validated.query, config.projects, validated.top_k, async (project, docPath) => {
|
|
7
|
+
const doc = await storageEngine.getDoc(docPath, project);
|
|
8
8
|
if (!doc)
|
|
9
9
|
return null;
|
|
10
10
|
return { title: doc.title, content: doc.content };
|
|
@@ -13,7 +13,8 @@ export async function searchDocs(storageEngine, embeddingEngine, args) {
|
|
|
13
13
|
return { content: [{ type: "text", text: "No matching documentation entries found." }] };
|
|
14
14
|
}
|
|
15
15
|
const lines = results.map((r, i) => {
|
|
16
|
-
|
|
16
|
+
const projectTag = r.project && r.project !== config.currentProject ? ` _(project: ${r.project})_` : "";
|
|
17
|
+
return `${i + 1}. **${r.title}** [${r.id}]${projectTag} — score: ${(r.score * 100).toFixed(1)}%\n ${r.excerpt}...`;
|
|
17
18
|
});
|
|
18
19
|
return {
|
|
19
20
|
content: [{ type: "text", text: `Search results for "${validated.query}":\n\n${lines.join("\n\n")}` }],
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const APP_VERSION = "1.0.
|
|
1
|
+
export declare const APP_VERSION = "1.0.43";
|
package/dist/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Auto-generated version file - do not edit manually
|
|
2
|
-
export const APP_VERSION = '1.0.
|
|
2
|
+
export const APP_VERSION = '1.0.43';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aY as L,bu as ln,aH as A,aW as P,aG as W,bv as gn,bw as dn,bx as hn,by as z,bz as pn,bp as An,bA as m,aZ as N,b2 as B,b5 as T,bB as _n,b0 as on,bC as wn,bs as On,aI as V,bq as vn,bD as R}from"./index-r9vO4oVD.js";var Pn="[object Symbol]";function x(n){return typeof n=="symbol"||L(n)&&ln(n)==Pn}function bn(n,r){for(var e=-1,i=n==null?0:n.length,f=Array(i);++e<i;)f[e]=r(n[e],e,n);return f}var U=P?P.prototype:void 0,H=U?U.toString:void 0;function k(n){if(typeof n=="string")return n;if(A(n))return bn(n,k)+"";if(x(n))return H?H.call(n):"";var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function yn(){}function En(n,r){for(var e=-1,i=n==null?0:n.length;++e<i&&r(n[e],e,n)!==!1;);return n}function cn(n,r,e,i){for(var f=n.length,t=e+-1;++t<f;)if(r(n[t],t,n))return t;return-1}function Tn(n){return n!==n}function In(n,r,e){for(var i=e-1,f=n.length;++i<f;)if(n[i]===r)return i;return-1}function Rn(n,r,e){return r===r?In(n,r,e):cn(n,Tn,e)}function Sn(n,r){var e=n==null?0:n.length;return!!e&&Rn(n,r,0)>-1}function M(n){return W(n)?gn(n):dn(n)}var Ln=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xn=/^\w*$/;function C(n,r){if(A(n))return!1;var e=typeof n;return e=="number"||e=="symbol"||e=="boolean"||n==null||x(n)?!0:xn.test(n)||!Ln.test(n)||r!=null&&n in Object(r)}var Mn=500;function Cn(n){var r=hn(n,function(i){return e.size===Mn&&e.clear(),i}),e=r.cache;return r}var $n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dn=/\\(\\)?/g,Gn=Cn(function(n){var r=[];return n.charCodeAt(0)===46&&r.push(""),n.replace($n,function(e,i,f,t){r.push(f?t.replace(Dn,"$1"):i||e)}),r});function Fn(n){return n==null?"":k(n)}function j(n,r){return A(n)?n:C(n,r)?[n]:Gn(Fn(n))}function I(n){if(typeof n=="string"||x(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function nn(n,r){r=j(r,n);for(var e=0,i=r.length;n!=null&&e<i;)n=n[I(r[e++])];return e&&e==i?n:void 0}function mn(n,r,e){var i=n==null?void 0:nn(n,r);return i===void 0?e:i}function rn(n,r){for(var e=-1,i=r.length,f=n.length;++e<i;)n[f+e]=r[e];return n}var K=P?P.isConcatSpreadable:void 0;function Nn(n){return A(n)||z(n)||!!(K&&n&&n[K])}function Kr(n,r,e,i,f){var t=-1,s=n.length;for(e||(e=Nn),f||(f=[]);++t<s;){var u=n[t];e(u)?rn(f,u):i||(f[f.length]=u)}return f}function Bn(n,r,e,i){var f=-1,t=n==null?0:n.length;for(i&&t&&(e=n[++f]);++f<t;)e=r(e,n[f],f,n);return e}function en(n,r){for(var e=-1,i=n==null?0:n.length,f=0,t=[];++e<i;){var s=n[e];r(s,e,n)&&(t[f++]=s)}return t}function Un(){return[]}var Hn=Object.prototype,Kn=Hn.propertyIsEnumerable,q=Object.getOwnPropertySymbols,qn=q?function(n){return n==null?[]:(n=Object(n),en(q(n),function(r){return Kn.call(n,r)}))}:Un;function Zn(n,r,e){var i=r(n);return A(n)?i:rn(i,e(n))}function Z(n){return Zn(n,M,qn)}var Yn="__lodash_hash_undefined__";function Xn(n){return this.__data__.set(n,Yn),this}function Jn(n){return this.__data__.has(n)}function b(n){var r=-1,e=n==null?0:n.length;for(this.__data__=new pn;++r<e;)this.add(n[r])}b.prototype.add=b.prototype.push=Xn;b.prototype.has=Jn;function Qn(n,r){for(var e=-1,i=n==null?0:n.length;++e<i;)if(r(n[e],e,n))return!0;return!1}function tn(n,r){return n.has(r)}var Wn=1,zn=2;function fn(n,r,e,i,f,t){var s=e&Wn,u=n.length,a=r.length;if(u!=a&&!(s&&a>u))return!1;var h=t.get(n),g=t.get(r);if(h&&g)return h==r&&g==n;var l=-1,d=!0,o=e&zn?new b:void 0;for(t.set(n,r),t.set(r,n);++l<u;){var p=n[l],_=r[l];if(i)var w=s?i(_,p,l,r,n,t):i(p,_,l,n,r,t);if(w!==void 0){if(w)continue;d=!1;break}if(o){if(!Qn(r,function(O,v){if(!tn(o,v)&&(p===O||f(p,O,e,i,t)))return o.push(v)})){d=!1;break}}else if(!(p===_||f(p,_,e,i,t))){d=!1;break}}return t.delete(n),t.delete(r),d}function Vn(n){var r=-1,e=Array(n.size);return n.forEach(function(i,f){e[++r]=[f,i]}),e}function $(n){var r=-1,e=Array(n.size);return n.forEach(function(i){e[++r]=i}),e}var kn=1,jn=2,nr="[object Boolean]",rr="[object Date]",er="[object Error]",ir="[object Map]",tr="[object Number]",fr="[object RegExp]",sr="[object Set]",ur="[object String]",ar="[object Symbol]",lr="[object ArrayBuffer]",gr="[object DataView]",Y=P?P.prototype:void 0,S=Y?Y.valueOf:void 0;function dr(n,r,e,i,f,t,s){switch(e){case gr:if(n.byteLength!=r.byteLength||n.byteOffset!=r.byteOffset)return!1;n=n.buffer,r=r.buffer;case lr:return!(n.byteLength!=r.byteLength||!t(new m(n),new m(r)));case nr:case rr:case tr:return An(+n,+r);case er:return n.name==r.name&&n.message==r.message;case fr:case ur:return n==r+"";case ir:var u=Vn;case sr:var a=i&kn;if(u||(u=$),n.size!=r.size&&!a)return!1;var h=s.get(n);if(h)return h==r;i|=jn,s.set(n,r);var g=fn(u(n),u(r),i,f,t,s);return s.delete(n),g;case ar:if(S)return S.call(n)==S.call(r)}return!1}var hr=1,pr=Object.prototype,Ar=pr.hasOwnProperty;function _r(n,r,e,i,f,t){var s=e&hr,u=Z(n),a=u.length,h=Z(r),g=h.length;if(a!=g&&!s)return!1;for(var l=a;l--;){var d=u[l];if(!(s?d in r:Ar.call(r,d)))return!1}var o=t.get(n),p=t.get(r);if(o&&p)return o==r&&p==n;var _=!0;t.set(n,r),t.set(r,n);for(var w=s;++l<a;){d=u[l];var O=n[d],v=r[d];if(i)var F=s?i(v,O,d,r,n,t):i(O,v,d,n,r,t);if(!(F===void 0?O===v||f(O,v,e,i,t):F)){_=!1;break}w||(w=d=="constructor")}if(_&&!w){var y=n.constructor,E=r.constructor;y!=E&&"constructor"in n&&"constructor"in r&&!(typeof y=="function"&&y instanceof y&&typeof E=="function"&&E instanceof E)&&(_=!1)}return t.delete(n),t.delete(r),_}var or=1,X="[object Arguments]",J="[object Array]",c="[object Object]",wr=Object.prototype,Q=wr.hasOwnProperty;function Or(n,r,e,i,f,t){var s=A(n),u=A(r),a=s?J:N(n),h=u?J:N(r);a=a==X?c:a,h=h==X?c:h;var g=a==c,l=h==c,d=a==h;if(d&&B(n)){if(!B(r))return!1;s=!0,g=!1}if(d&&!g)return t||(t=new T),s||_n(n)?fn(n,r,e,i,f,t):dr(n,r,a,e,i,f,t);if(!(e&or)){var o=g&&Q.call(n,"__wrapped__"),p=l&&Q.call(r,"__wrapped__");if(o||p){var _=o?n.value():n,w=p?r.value():r;return t||(t=new T),f(_,w,e,i,t)}}return d?(t||(t=new T),_r(n,r,e,i,f,t)):!1}function D(n,r,e,i,f){return n===r?!0:n==null||r==null||!L(n)&&!L(r)?n!==n&&r!==r:Or(n,r,e,i,D,f)}var vr=1,Pr=2;function br(n,r,e,i){var f=e.length,t=f;if(n==null)return!t;for(n=Object(n);f--;){var s=e[f];if(s[2]?s[1]!==n[s[0]]:!(s[0]in n))return!1}for(;++f<t;){s=e[f];var u=s[0],a=n[u],h=s[1];if(s[2]){if(a===void 0&&!(u in n))return!1}else{var g=new T,l;if(!(l===void 0?D(h,a,vr|Pr,i,g):l))return!1}}return!0}function sn(n){return n===n&&!on(n)}function yr(n){for(var r=M(n),e=r.length;e--;){var i=r[e],f=n[i];r[e]=[i,f,sn(f)]}return r}function un(n,r){return function(e){return e==null?!1:e[n]===r&&(r!==void 0||n in Object(e))}}function Er(n){var r=yr(n);return r.length==1&&r[0][2]?un(r[0][0],r[0][1]):function(e){return e===n||br(e,n,r)}}function cr(n,r){return n!=null&&r in Object(n)}function Tr(n,r,e){r=j(r,n);for(var i=-1,f=r.length,t=!1;++i<f;){var s=I(r[i]);if(!(t=n!=null&&e(n,s)))break;n=n[s]}return t||++i!=f?t:(f=n==null?0:n.length,!!f&&wn(f)&&On(s,f)&&(A(n)||z(n)))}function Ir(n,r){return n!=null&&Tr(n,r,cr)}var Rr=1,Sr=2;function Lr(n,r){return C(n)&&sn(r)?un(I(n),r):function(e){var i=mn(e,n);return i===void 0&&i===r?Ir(e,n):D(r,i,Rr|Sr)}}function xr(n){return function(r){return r?.[n]}}function Mr(n){return function(r){return nn(r,n)}}function Cr(n){return C(n)?xr(I(n)):Mr(n)}function an(n){return typeof n=="function"?n:n==null?V:typeof n=="object"?A(n)?Lr(n[0],n[1]):Er(n):Cr(n)}function $r(n,r){return n&&vn(n,r,M)}function Dr(n,r){return function(e,i){if(e==null)return e;if(!W(e))return n(e,i);for(var f=e.length,t=-1,s=Object(e);++t<f&&i(s[t],t,s)!==!1;);return e}}var G=Dr($r);function Gr(n){return typeof n=="function"?n:V}function qr(n,r){var e=A(n)?En:G;return e(n,Gr(r))}function Fr(n,r){var e=[];return G(n,function(i,f,t){r(i,f,t)&&e.push(i)}),e}function Zr(n,r){var e=A(n)?en:Fr;return e(n,an(r))}function mr(n,r,e,i,f){return f(n,function(t,s,u){e=i?(i=!1,t):r(e,t,s,u)}),e}function Yr(n,r,e){var i=A(n)?Bn:mr,f=arguments.length<3;return i(n,an(r),e,f,G)}var Nr=1/0,Br=R&&1/$(new R([,-0]))[1]==Nr?function(n){return new R(n)}:yn,Ur=200;function Xr(n,r,e){var i=-1,f=Sn,t=n.length,s=!0,u=[],a=u;if(t>=Ur){var h=r?null:Br(n);if(h)return $(h);s=!1,f=tn,a=new b}else a=r?[]:u;n:for(;++i<t;){var g=n[i],l=r?r(g):g;if(g=g!==0?g:0,s&&l===l){for(var d=a.length;d--;)if(a[d]===l)continue n;r&&a.push(l),u.push(g)}else f(a,l,e)||(a!==u&&a.push(l),u.push(g))}return u}export{G as a,Kr as b,an as c,bn as d,rn as e,Zn as f,qn as g,En as h,x as i,Z as j,M as k,Xr as l,Zr as m,qr as n,cn as o,Gr as p,$r as q,Yr as r,Un as s,Tr as t,j as u,I as v,nn as w,Ir as x,Fn as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a0 as ln,a1 as an,a2 as y,a3 as tn,a4 as H,a5 as q,a6 as _,a7 as un,a8 as rn,a9 as L,aa as o,ab as B,ac as sn,ad as on,ae as fn}from"./index-r9vO4oVD.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,C,a){var O=I-l,i=D-h,n=C-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function W(l,h,I,D,v,A,C){var a=l-I,O=h-D,i=(C?A:-A)/L(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,F=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*L(fn(0,T*T*R-P*P)),j=(P*g-m*S)/R,z=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=j-F,e=z-t,r=w-F,G=p-t;return x*x+e*e>r*r+G*G&&(j=w,z=p),{cx:j,cy:z,x01:-n,y01:-d,x11:j*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=yn,I=B(0),D=null,v=gn,A=dn,C=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,F=un(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(F>tn-y)a.moveTo(s*H(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*H(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=F,S=F,j=C.apply(this,arguments)/2,z=j>y&&(D?+D.apply(this,arguments):L(u*u+s*s)),w=_(un(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(z>y){var G=sn(z/u*q(j)),M=sn(z/s*q(j));(P-=G*2)>y?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(S-=M*2)>y?(M*=t?1:-1,m+=M,g-=M):(S=0,m=g=(f+c)/2)}var J=s*H(m),K=s*q(m),N=u*H(T),Q=u*q(T);if(w>y){var U=s*H(g),V=s*q(g),X=u*H(R),Y=u*q(R),E;if(F<rn)if(E=pn(J,K,X,Y,U,V,N,Q)){var Z=J-E[0],$=K-E[1],b=U-E[0],k=V-E[1],nn=1/q(on((Z*b+$*k)/(L(Z*Z+$*$)*L(b*b+k*k)))/2),en=L(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(J,K),a.arc(0,0,s,m,g,!t)):a.moveTo(J,K),!(u>y)||!(P>y)?a.lineTo(N,Q):p>y?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-rn/2;return[H(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:B(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:B(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:B(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:B(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:B(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:B(+n),i):A},i.padAngle=function(n){return arguments.length?(C=typeof n=="function"?n:B(+n),i):C},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|