import './dgmo-router-CY5j16Pl.js'; import { a as PaletteColors, T as TagGroup, D as DgmoError } from './tag-groups-DrHT2tEc.js'; /** Convert hex (#RRGGBB or #RGB) to { h, s, l } with h in degrees, s/l as percentages. */ declare function hexToHSL(hex: string): { h: number; s: number; l: number; }; /** Convert { h (degrees), s (%), l (%) } back to #RRGGBB hex string. */ declare function hslToHex(h: number, s: number, l: number): string; /** Convert hex to "H S% L%" string for CSS custom properties. */ declare function hexToHSLString(hex: string): string; /** * Blend a color toward white (light mode quadrant fills). * amount: 0 = original, 1 = white */ declare function tint(hex: string, amount: number): string; /** * Blend a color toward a dark base (dark mode quadrant fills). * amount: 0 = original, 1 = base */ declare function shade(hex: string, base: string, amount: number): string; /** * Blend two hex colors by percentage. * `pct` = 0 → 100% of `b`, `pct` = 100 → 100% of `a`. * * Used by all renderers for tinted fills and strokes. */ declare function mix(a: string, b: string, pct: number): string; /** * Pick `lightText` or `darkText` for placement on top of `bg`: whichever * scores the higher |Lc| under APCA. * * This replaced a WCAG-ratio three-tier heuristic on 2026-08-11. The WCAG * 2.1 ratio formula has a known blind spot on mid-tone fills, preferring * dark ink where every eye wants light text — slate light gray `#7e8a97` * scores 4.19:1 dark vs 3.35:1 light on WCAG, but Lc 37 dark vs Lc 68 * light on APCA. 30 of the 154 palette solid fills (7 palettes × 2 modes * × 11 intents) got the perceptually weaker token from the old picker. * * `tests/palette-contrast.test.ts` guards the whole registry: the picker * must return the stronger token for every fill, and a fill whose best * |Lc| falls under 45 is a palette defect the test names. */ declare function contrastText(bg: string, lightText: string, darkText: string): string; declare function shapeFill(palette: PaletteColors, intent: string, isDark: boolean, opts?: { mode?: 'solid' | 'outline' | undefined; }): string; /** * Derive the 8-color series rotation from a palette's named colors, in the * shared {@link CATEGORICAL_COLOR_ORDER} (RGB-seeded, max-contrast). Tag * swatches and chart series colors thus share one canonical rotation. */ declare function getSeriesColors(palette: PaletteColors): string[]; interface OrgNode { readonly id: string; readonly label: string; readonly metadata: Readonly>; readonly children: readonly OrgNode[]; readonly parentId: string | null; readonly isContainer: boolean; readonly lineNumber: number; readonly color?: string; /** * Seeded collapsed by source — `collapsed: true` on the node's own line, or * as an indented key under it / under a `[Container]` header (§6.5). * Lifted out of `metadata` at end of parse so it drives render and export * rather than being drawn as an attribute row. */ readonly collapsed?: boolean; } interface ParsedOrg { readonly title: string | null; readonly titleLineNumber: number | null; readonly roots: readonly OrgNode[]; readonly tagGroups: readonly TagGroup[]; readonly options: Readonly>; /** * Resolved layout direction (§7.5). `direction-lr` / `direction-tb` are a * mutually-exclusive boolean pair (§1.9, last one wins). Defaults to 'TB', * which is the orientation org charts have always rendered. */ readonly direction: 'LR' | 'TB'; readonly diagnostics: readonly DgmoError[]; readonly error: string | null; } declare function parseOrg(content: string, palette?: PaletteColors): ParsedOrg; /** * Resolve a `focus ` directive value to a node id — case-insensitive * match on the person's (or team container's) display label, depth-first in * source order, first match wins. Returns null when nothing matches. */ declare function findOrgNodeIdByName(nodes: readonly OrgNode[], name: string): string | null; /** * Substitute `start-date now` with the host-local resolved date. * Pass the result to `encodeDiagramUrl` so the share-link captures * the resolved date, not the literal token. * * Lines without `start-date now` (explicit-date lines, comments, * other directives, activity lines containing the word "now") pass * through verbatim. */ declare function normalizePertSourceForShare(dsl: string): string; /** * Shared parser utilities — extracted from individual parsers to eliminate * duplication of measureIndent, extractColor, header regexes, and * pipe-metadata parsing. */ /** * Complete set of recognized chart type identifiers. * * Derived from `chart-types.ts`, which is a leaf module — importing the * chart-type *registry* here would be circular, since the registry imports * every parser and 34 parsers import this file. */ declare const ALL_CHART_TYPES: ReadonlySet; /** * Cross-chart fill treatment (spec §1.9 fill family). Absent ⇒ the canonical * 25% tint (`fill-tint` is the explicit spelling of that default). */ type FillMode = 'solid' | 'outline'; /** * Parse the first non-empty, non-comment line to extract chart type and optional title. * The first token is matched against `ALL_CHART_TYPES`; the remainder is the title. * * Returns `null` if the first token is not a recognized chart type. */ declare function parseFirstLine(line: string): { chartType: string; title: string | undefined; } | null; /** Marker alphabet member for any variant. */ type RaciMarker = 'R' | 'A' | 'S' | 'C' | 'I' | 'D'; /** Variant identifier — selects alphabet + constraint rule set. */ type RaciVariant = 'raci' | 'rasci' | 'daci'; /** * One `Role: ` line under a task. * * `id` is the normalized role key — used by mutations to look up the * cell and by validation to detect unknown roles. `displayName` is the * first-seen casing/spacing for rendering. */ interface RaciRoleAssignment { readonly id: string; readonly displayName: string; readonly markers: readonly RaciMarker[]; readonly lineNumber: number; readonly endLineNumber: number; } /** One task — flush-left under a phase or directly under the chart. */ interface RaciTask { readonly id: string; readonly displayName: string; readonly description: string; readonly roleAssignments: readonly RaciRoleAssignment[]; readonly lineNumber: number; readonly endLineNumber: number; } /** Optional `[Phase Label]` group header — one level deep. */ interface RaciPhase { readonly id: string; readonly displayName: string; /** Optional palette color from a `[Label](color)` suffix on the bracket. */ readonly color?: string; readonly tasks: readonly RaciTask[]; readonly lineNumber: number; readonly endLineNumber: number; } /** Top-level parse result. */ interface ParsedRaci { readonly type: 'raci'; /** Optional title from the chart-type header line. */ readonly title?: string; readonly titleLineNumber?: number; /** Variant selected by directive, or by chart-type id when absent. */ readonly variant: RaciVariant; /** * Canonical column order. Populated either from an explicit * `roles:` directive or, when absent, from first-seen role usage. */ readonly roles: readonly string[]; /** Display name for each role (parallel to `roles`). */ readonly roleDisplayNames: readonly string[]; /** * Optional per-role palette color from the `Cap blue` trailing-token * suffix in the roles block (or the long pipe form `Cap | color: blue`). * Parallel to `roles`; entries default to `undefined` (renderer falls * back to the neutral column tint). */ readonly roleColors: ReadonlyArray; readonly phases: readonly RaciPhase[]; /** Tasks declared without a parent phase. */ readonly tasksWithoutPhase: readonly RaciTask[]; readonly options: Readonly>; readonly diagnostics: readonly DgmoError[]; readonly error: string | null; } /** * Parse RACI/RASCI/DACI source. The leading chart-type id (if a * recognized variant id) acts as a hint for default variant when the * `variant` directive is absent. */ declare function parseRaci(content: string, palette?: PaletteColors): ParsedRaci; /** * Async or sync file reader. Receives an absolute path, returns content. * Throwing means "file not found". */ type ReadFileFn = (path: string) => string | Promise; /** Tracks the original source file and line for an imported line. */ interface ImportSource { /** Absolute path of the file this line originates from */ filePath: string; /** 1-based line number in the original (pre-resolution) source file */ sourceLine: number; } interface ResolveImportsResult { content: string; diagnostics: DgmoError[]; /** resolvedLine (1-based index) → originalLine (1-based) or null for inserted lines */ lineMap: (number | null)[]; /** resolvedLine (1-based index) → import source info or null for non-imported lines */ importSourceMap: (ImportSource | null)[]; } /** * Pre-processes org chart content, resolving `import` directives — column 0 * pulls in a file's tag groups, indented splices in its subtree. * * @param content - Raw .dgmo file content * @param filePath - Absolute path of the file (for relative path resolution) * @param readFileFn - Function to read files (sync or async) * @returns Merged content with all imports resolved + diagnostics */ declare function resolveOrgImports(content: string, filePath: string, readFileFn: ReadFileFn): Promise; export { ALL_CHART_TYPES as A, type FillMode as F, type ImportSource as I, type OrgNode as O, type ParsedOrg as P, type RaciMarker as R, type ParsedRaci as a, type RaciVariant as b, type RaciTask as c, type RaciPhase as d, type RaciRoleAssignment as e, type ReadFileFn as f, type ResolveImportsResult as g, contrastText as h, findOrgNodeIdByName as i, getSeriesColors as j, hexToHSL as k, hexToHSLString as l, hslToHex as m, mix as n, normalizePertSourceForShare as o, parseFirstLine as p, parseOrg as q, parseRaci as r, resolveOrgImports as s, shade as t, shapeFill as u, tint as v };