@nowline/layout 0.0.0-dev.20260601071750.g04bdff9

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.
Files changed (193) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +103 -0
  3. package/dist/band-scale.d.ts +56 -0
  4. package/dist/band-scale.d.ts.map +1 -0
  5. package/dist/band-scale.js +86 -0
  6. package/dist/band-scale.js.map +1 -0
  7. package/dist/calendar.d.ts +79 -0
  8. package/dist/calendar.d.ts.map +1 -0
  9. package/dist/calendar.js +210 -0
  10. package/dist/calendar.js.map +1 -0
  11. package/dist/capacity.d.ts +72 -0
  12. package/dist/capacity.d.ts.map +1 -0
  13. package/dist/capacity.js +163 -0
  14. package/dist/capacity.js.map +1 -0
  15. package/dist/dsl-utils.d.ts +5 -0
  16. package/dist/dsl-utils.d.ts.map +1 -0
  17. package/dist/dsl-utils.js +28 -0
  18. package/dist/dsl-utils.js.map +1 -0
  19. package/dist/edge-routing.d.ts +89 -0
  20. package/dist/edge-routing.d.ts.map +1 -0
  21. package/dist/edge-routing.js +435 -0
  22. package/dist/edge-routing.js.map +1 -0
  23. package/dist/frame-tab-geometry.d.ts +78 -0
  24. package/dist/frame-tab-geometry.d.ts.map +1 -0
  25. package/dist/frame-tab-geometry.js +115 -0
  26. package/dist/frame-tab-geometry.js.map +1 -0
  27. package/dist/header-card-geometry.d.ts +29 -0
  28. package/dist/header-card-geometry.d.ts.map +1 -0
  29. package/dist/header-card-geometry.js +41 -0
  30. package/dist/header-card-geometry.js.map +1 -0
  31. package/dist/i18n.d.ts +48 -0
  32. package/dist/i18n.d.ts.map +1 -0
  33. package/dist/i18n.js +114 -0
  34. package/dist/i18n.js.map +1 -0
  35. package/dist/include-chrome-geometry.d.ts +86 -0
  36. package/dist/include-chrome-geometry.d.ts.map +1 -0
  37. package/dist/include-chrome-geometry.js +104 -0
  38. package/dist/include-chrome-geometry.js.map +1 -0
  39. package/dist/index.d.ts +11 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +10 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/inline-date-pin-geometry.d.ts +46 -0
  44. package/dist/inline-date-pin-geometry.d.ts.map +1 -0
  45. package/dist/inline-date-pin-geometry.js +149 -0
  46. package/dist/inline-date-pin-geometry.js.map +1 -0
  47. package/dist/item-bar-geometry.d.ts +157 -0
  48. package/dist/item-bar-geometry.d.ts.map +1 -0
  49. package/dist/item-bar-geometry.js +214 -0
  50. package/dist/item-bar-geometry.js.map +1 -0
  51. package/dist/lane-utilization.d.ts +90 -0
  52. package/dist/lane-utilization.d.ts.map +1 -0
  53. package/dist/lane-utilization.js +206 -0
  54. package/dist/lane-utilization.js.map +1 -0
  55. package/dist/layout-context.d.ts +143 -0
  56. package/dist/layout-context.d.ts.map +1 -0
  57. package/dist/layout-context.js +8 -0
  58. package/dist/layout-context.js.map +1 -0
  59. package/dist/layout.d.ts +18 -0
  60. package/dist/layout.d.ts.map +1 -0
  61. package/dist/layout.js +1298 -0
  62. package/dist/layout.js.map +1 -0
  63. package/dist/nodes/anchor-node.d.ts +16 -0
  64. package/dist/nodes/anchor-node.d.ts.map +1 -0
  65. package/dist/nodes/anchor-node.js +68 -0
  66. package/dist/nodes/anchor-node.js.map +1 -0
  67. package/dist/nodes/footnote-node.d.ts +10 -0
  68. package/dist/nodes/footnote-node.d.ts.map +1 -0
  69. package/dist/nodes/footnote-node.js +41 -0
  70. package/dist/nodes/footnote-node.js.map +1 -0
  71. package/dist/nodes/group-node.d.ts +29 -0
  72. package/dist/nodes/group-node.d.ts.map +1 -0
  73. package/dist/nodes/group-node.js +195 -0
  74. package/dist/nodes/group-node.js.map +1 -0
  75. package/dist/nodes/include-node.d.ts +16 -0
  76. package/dist/nodes/include-node.d.ts.map +1 -0
  77. package/dist/nodes/include-node.js +117 -0
  78. package/dist/nodes/include-node.js.map +1 -0
  79. package/dist/nodes/item-node.d.ts +51 -0
  80. package/dist/nodes/item-node.d.ts.map +1 -0
  81. package/dist/nodes/item-node.js +108 -0
  82. package/dist/nodes/item-node.js.map +1 -0
  83. package/dist/nodes/marker-geometry.d.ts +22 -0
  84. package/dist/nodes/marker-geometry.d.ts.map +1 -0
  85. package/dist/nodes/marker-geometry.js +38 -0
  86. package/dist/nodes/marker-geometry.js.map +1 -0
  87. package/dist/nodes/milestone-node.d.ts +48 -0
  88. package/dist/nodes/milestone-node.d.ts.map +1 -0
  89. package/dist/nodes/milestone-node.js +210 -0
  90. package/dist/nodes/milestone-node.js.map +1 -0
  91. package/dist/nodes/parallel-node.d.ts +21 -0
  92. package/dist/nodes/parallel-node.d.ts.map +1 -0
  93. package/dist/nodes/parallel-node.js +88 -0
  94. package/dist/nodes/parallel-node.js.map +1 -0
  95. package/dist/nodes/roadmap-node.d.ts +76 -0
  96. package/dist/nodes/roadmap-node.d.ts.map +1 -0
  97. package/dist/nodes/roadmap-node.js +788 -0
  98. package/dist/nodes/roadmap-node.js.map +1 -0
  99. package/dist/nodes/swimlane-node.d.ts +38 -0
  100. package/dist/nodes/swimlane-node.d.ts.map +1 -0
  101. package/dist/nodes/swimlane-node.js +308 -0
  102. package/dist/nodes/swimlane-node.js.map +1 -0
  103. package/dist/renderable.d.ts +44 -0
  104. package/dist/renderable.d.ts.map +1 -0
  105. package/dist/renderable.js +21 -0
  106. package/dist/renderable.js.map +1 -0
  107. package/dist/row-packer.d.ts +125 -0
  108. package/dist/row-packer.d.ts.map +1 -0
  109. package/dist/row-packer.js +169 -0
  110. package/dist/row-packer.js.map +1 -0
  111. package/dist/style-resolution.d.ts +14 -0
  112. package/dist/style-resolution.d.ts.map +1 -0
  113. package/dist/style-resolution.js +191 -0
  114. package/dist/style-resolution.js.map +1 -0
  115. package/dist/themes/dark.d.ts +4 -0
  116. package/dist/themes/dark.d.ts.map +1 -0
  117. package/dist/themes/dark.js +241 -0
  118. package/dist/themes/dark.js.map +1 -0
  119. package/dist/themes/grayscale.d.ts +4 -0
  120. package/dist/themes/grayscale.d.ts.map +1 -0
  121. package/dist/themes/grayscale.js +237 -0
  122. package/dist/themes/grayscale.js.map +1 -0
  123. package/dist/themes/index.d.ts +19 -0
  124. package/dist/themes/index.d.ts.map +1 -0
  125. package/dist/themes/index.js +57 -0
  126. package/dist/themes/index.js.map +1 -0
  127. package/dist/themes/light.d.ts +4 -0
  128. package/dist/themes/light.d.ts.map +1 -0
  129. package/dist/themes/light.js +248 -0
  130. package/dist/themes/light.js.map +1 -0
  131. package/dist/themes/shape.d.ts +194 -0
  132. package/dist/themes/shape.d.ts.map +1 -0
  133. package/dist/themes/shape.js +6 -0
  134. package/dist/themes/shape.js.map +1 -0
  135. package/dist/themes/shared.d.ts +145 -0
  136. package/dist/themes/shared.d.ts.map +1 -0
  137. package/dist/themes/shared.js +310 -0
  138. package/dist/themes/shared.js.map +1 -0
  139. package/dist/time-scale.d.ts +39 -0
  140. package/dist/time-scale.d.ts.map +1 -0
  141. package/dist/time-scale.js +62 -0
  142. package/dist/time-scale.js.map +1 -0
  143. package/dist/types.d.ts +516 -0
  144. package/dist/types.d.ts.map +1 -0
  145. package/dist/types.js +6 -0
  146. package/dist/types.js.map +1 -0
  147. package/dist/view-preset.d.ts +23 -0
  148. package/dist/view-preset.d.ts.map +1 -0
  149. package/dist/view-preset.js +146 -0
  150. package/dist/view-preset.js.map +1 -0
  151. package/dist/working-calendar.d.ts +14 -0
  152. package/dist/working-calendar.d.ts.map +1 -0
  153. package/dist/working-calendar.js +74 -0
  154. package/dist/working-calendar.js.map +1 -0
  155. package/package.json +43 -0
  156. package/src/band-scale.ts +115 -0
  157. package/src/calendar.ts +244 -0
  158. package/src/capacity.ts +191 -0
  159. package/src/dsl-utils.ts +30 -0
  160. package/src/edge-routing.ts +550 -0
  161. package/src/frame-tab-geometry.ts +165 -0
  162. package/src/header-card-geometry.ts +48 -0
  163. package/src/i18n.ts +124 -0
  164. package/src/include-chrome-geometry.ts +156 -0
  165. package/src/index.ts +118 -0
  166. package/src/inline-date-pin-geometry.ts +196 -0
  167. package/src/item-bar-geometry.ts +271 -0
  168. package/src/lane-utilization.ts +259 -0
  169. package/src/layout-context.ts +182 -0
  170. package/src/layout.ts +1530 -0
  171. package/src/nodes/anchor-node.ts +77 -0
  172. package/src/nodes/footnote-node.ts +60 -0
  173. package/src/nodes/group-node.ts +260 -0
  174. package/src/nodes/include-node.ts +168 -0
  175. package/src/nodes/item-node.ts +171 -0
  176. package/src/nodes/marker-geometry.ts +43 -0
  177. package/src/nodes/milestone-node.ts +263 -0
  178. package/src/nodes/parallel-node.ts +110 -0
  179. package/src/nodes/roadmap-node.ts +957 -0
  180. package/src/nodes/swimlane-node.ts +423 -0
  181. package/src/renderable.ts +68 -0
  182. package/src/row-packer.ts +271 -0
  183. package/src/style-resolution.ts +243 -0
  184. package/src/themes/dark.ts +244 -0
  185. package/src/themes/grayscale.ts +240 -0
  186. package/src/themes/index.ts +66 -0
  187. package/src/themes/light.ts +251 -0
  188. package/src/themes/shape.ts +230 -0
  189. package/src/themes/shared.ts +369 -0
  190. package/src/time-scale.ts +78 -0
  191. package/src/types.ts +641 -0
  192. package/src/view-preset.ts +180 -0
  193. package/src/working-calendar.ts +91 -0
@@ -0,0 +1,21 @@
1
+ import type { GroupBlock, ItemDeclaration, ParallelBlock } from '@nowline/core';
2
+ import type { LayoutContext, TrackCursor } from '../layout-context.js';
3
+ import type { PositionedParallel, PositionedTrackChild } from '../types.js';
4
+ export interface ParallelNodeDeps {
5
+ sequenceOne: (child: ItemDeclaration | GroupBlock | ParallelBlock, cursor: TrackCursor, ctx: LayoutContext) => PositionedTrackChild;
6
+ newCursor: (x: number, y: number) => TrackCursor;
7
+ }
8
+ export declare class ParallelNode {
9
+ readonly node: ParallelBlock;
10
+ private readonly deps;
11
+ constructor(node: ParallelBlock, deps: ParallelNodeDeps);
12
+ get id(): string;
13
+ /**
14
+ * Sequence children into stacked sub-tracks, advance the parent
15
+ * `cursor` past the parallel's right edge plus
16
+ * `TRACK_BLOCK_TAIL_GUTTER_PX` of breathing room, and return a
17
+ * `PositionedParallel`.
18
+ */
19
+ place(cursor: TrackCursor, ctx: LayoutContext): PositionedParallel;
20
+ }
21
+ //# sourceMappingURL=parallel-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallel-node.d.ts","sourceRoot":"","sources":["../../src/nodes/parallel-node.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGhF,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGvE,OAAO,KAAK,EAAe,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEzF,MAAM,WAAW,gBAAgB;IAC7B,WAAW,EAAE,CACT,KAAK,EAAE,eAAe,GAAG,UAAU,GAAG,aAAa,EACnD,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,aAAa,KACjB,oBAAoB,CAAC;IAC1B,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,WAAW,CAAC;CACpD;AAED,qBAAa,YAAY;aAED,IAAI,EAAE,aAAa;IAEnC,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAFL,IAAI,EAAE,aAAa,EAElB,IAAI,EAAE,gBAAgB;IAG3C,IAAI,EAAE,IAAI,MAAM,CAEf;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,aAAa,GAAG,kBAAkB;CAoErE"}
@@ -0,0 +1,88 @@
1
+ // ParallelNode — Renderable for a `parallel { ... }` block. Stacks
2
+ // children top-to-bottom (each child owns a fresh sub-track) and reports
3
+ // the union bounding box. Each child is sequenced via the injected
4
+ // `deps.sequenceOne` callback, which dispatches to the appropriate
5
+ // per-entity Renderable (or, transitionally, the legacy sequencer
6
+ // helpers in `layout.ts`).
7
+ import { propValues } from '../dsl-utils.js';
8
+ import { computeContainerInlineDatePins, pickInlineDate } from '../inline-date-pin-geometry.js';
9
+ import { resolveStyle } from '../style-resolution.js';
10
+ import { TRACK_BLOCK_TAIL_GUTTER_PX } from '../themes/shared.js';
11
+ export class ParallelNode {
12
+ node;
13
+ deps;
14
+ constructor(node,
15
+ // biome-ignore lint/correctness/noUnusedPrivateClassMembers: accessed via `const { deps } = this` destructuring inside methods, which the analyzer does not detect.
16
+ deps) {
17
+ this.node = node;
18
+ this.deps = deps;
19
+ }
20
+ get id() {
21
+ return this.node.name ?? '';
22
+ }
23
+ /**
24
+ * Sequence children into stacked sub-tracks, advance the parent
25
+ * `cursor` past the parallel's right edge plus
26
+ * `TRACK_BLOCK_TAIL_GUTTER_PX` of breathing room, and return a
27
+ * `PositionedParallel`.
28
+ */
29
+ place(cursor, ctx) {
30
+ const { node } = this;
31
+ const { deps } = this;
32
+ const style = resolveStyle('parallel', node.properties, ctx.styleCtx);
33
+ const startX = cursor.x;
34
+ const startY = cursor.y;
35
+ const children = [];
36
+ let maxRight = startX;
37
+ let accumulatedHeight = 0;
38
+ // Each child of a parallel block lives on its own sub-track,
39
+ // so each child starts a fresh flow segment under the parent's
40
+ // path. Two predecessors that sit on different parallel
41
+ // sub-tracks therefore stay in different flows for milestone
42
+ // slack-arrow dedupe.
43
+ const previousFlowKey = ctx.currentFlowKey;
44
+ const parId = node.name ?? 'p';
45
+ let childIndex = 0;
46
+ for (const child of node.content) {
47
+ if (child.$type === 'DescriptionDirective')
48
+ continue;
49
+ ctx.currentFlowKey = `${previousFlowKey}/par:${parId}#${childIndex}`;
50
+ const subCursor = deps.newCursor(startX, startY + accumulatedHeight);
51
+ const positioned = deps.sequenceOne(child, subCursor, ctx);
52
+ children.push(positioned);
53
+ accumulatedHeight += Math.max(ctx.bandScale.step(), subCursor.height);
54
+ maxRight = Math.max(maxRight, subCursor.maxX);
55
+ childIndex++;
56
+ }
57
+ ctx.currentFlowKey = previousFlowKey;
58
+ const box = {
59
+ x: startX,
60
+ y: startY,
61
+ width: maxRight - startX,
62
+ height: accumulatedHeight,
63
+ };
64
+ cursor.x = maxRight + TRACK_BLOCK_TAIL_GUTTER_PX;
65
+ cursor.maxX = Math.max(cursor.maxX, cursor.x);
66
+ cursor.height = Math.max(cursor.height, accumulatedHeight);
67
+ const id = node.name;
68
+ if (id) {
69
+ ctx.entityLeftEdges.set(id, box.x);
70
+ ctx.entityRightEdges.set(id, box.x + box.width);
71
+ }
72
+ const inlineDatePins = computeContainerInlineDatePins({
73
+ box,
74
+ afterDate: pickInlineDate(propValues(node.properties, 'after')),
75
+ beforeDate: pickInlineDate(propValues(node.properties, 'before')),
76
+ });
77
+ return {
78
+ kind: 'parallel',
79
+ id,
80
+ title: node.title ?? node.name,
81
+ box,
82
+ children,
83
+ style,
84
+ inlineDatePins: inlineDatePins.length > 0 ? inlineDatePins : undefined,
85
+ };
86
+ }
87
+ }
88
+ //# sourceMappingURL=parallel-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallel-node.js","sourceRoot":"","sources":["../../src/nodes/parallel-node.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,yEAAyE;AACzE,mEAAmE;AACnE,mEAAmE;AACnE,kEAAkE;AAClE,2BAA2B;AAG3B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,8BAA8B,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhG,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAYjE,MAAM,OAAO,YAAY;IAED;IAEC;IAHrB,YACoB,IAAmB;IACnC,oKAAoK;IACnJ,IAAsB;QAFvB,SAAI,GAAJ,IAAI,CAAe;QAElB,SAAI,GAAJ,IAAI,CAAkB;IACxC,CAAC;IAEJ,IAAI,EAAE;QACF,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;IAChC,CAAC;IAED;;;;;O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AK;YACL,cAAc,EAAE,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS;SACzE,CAAC;IACN,CAAC;CACJ"}
@@ -0,0 +1,76 @@
1
+ import type { ItemDeclaration, NowlineFile, ResolveResult, SwimlaneDeclaration } from '@nowline/core';
2
+ import type { CalendarConfig } from '../calendar.js';
3
+ import type { LayoutOptions, LayoutResult } from '../layout.js';
4
+ import type { LayoutContext, LayoutHelpers } from '../layout-context.js';
5
+ import type { BoundingBox, PositionedDependencyEdge, PositionedIncludeRegion, PositionedNowline, PositionedSwimlane } from '../types.js';
6
+ import type { ViewPreset } from '../view-preset.js';
7
+ /** Sized output from the beside-mode header word-wrap pass. */
8
+ export interface SizedHeader {
9
+ titleLines: string[];
10
+ authorLines: string[];
11
+ cardWidth: number;
12
+ cardHeight: number;
13
+ boxWidth: number;
14
+ }
15
+ /**
16
+ * Bundle of orchestration + sequencer helpers RoadmapNode delegates to.
17
+ * `layout.ts` builds this struct from its private helpers and passes it
18
+ * once when calling `RoadmapNode.place(...)`.
19
+ */
20
+ export interface RoadmapNodeDeps extends LayoutHelpers {
21
+ computeDateWindow: (file: NowlineFile, ctx: {
22
+ cal: CalendarConfig;
23
+ sizes: Map<string, import('../types.js').ResolvedSize>;
24
+ }, resolved: ResolveResult, today: Date | undefined, scale: ViewPreset) => {
25
+ startDate: Date;
26
+ endDate: Date;
27
+ };
28
+ sizeBesideHeader: (title: string, author: string | undefined) => SizedHeader;
29
+ collectItems: (swimlanes: SwimlaneDeclaration[]) => Map<string, ItemDeclaration>;
30
+ buildDependencies: (items: Map<string, ItemDeclaration>, swimlanes: PositionedSwimlane[], includes: PositionedIncludeRegion[], ctx: LayoutContext) => PositionedDependencyEdge[];
31
+ buildNowline: (today: Date | undefined, ctx: LayoutContext, locale: string) => PositionedNowline | null;
32
+ }
33
+ export declare class RoadmapNode {
34
+ place(file: NowlineFile, resolved: ResolveResult, options: LayoutOptions, deps: RoadmapNodeDeps): LayoutResult;
35
+ }
36
+ interface MarkerEntity {
37
+ id: string;
38
+ centerX: number;
39
+ radius: number;
40
+ title: string;
41
+ fontSize: number;
42
+ bold: boolean;
43
+ }
44
+ interface PackedPlacement {
45
+ rowIndex: number;
46
+ labelBox: BoundingBox;
47
+ labelSide: 'left' | 'right';
48
+ }
49
+ /**
50
+ * Pack anchors + milestones into marker rows using a bottom-first
51
+ * tick-order strategy. Markers default to the row CLOSEST to the
52
+ * chart; conflicts push them UP toward the date ticks (the inverse of
53
+ * swimlane items which default to the top and push down).
54
+ *
55
+ * Walk order is left-to-right by `centerX` (tick order, not file
56
+ * declaration). For each marker:
57
+ * 1. Try the bottommost existing row (highest `rowIndex`), right
58
+ * side first then left, working UP through the rows.
59
+ * 2. If neither side fits at any existing row, GROW: prepend a new
60
+ * row at `rowIndex = 0`. Every previously-placed marker has its
61
+ * `rowIndex` incremented by 1 so the bottom corridor stays
62
+ * stable as the band expands upward toward the ticks.
63
+ *
64
+ * Returns row-relative placements (no centerY yet — caller fills that
65
+ * in once `markerRowY` is known). Row indices follow the existing
66
+ * convention: 0 = top of band (closest to ticks), `rowCount - 1` =
67
+ * bottom of band (closest to chart). The "bottom-first" preference
68
+ * lives entirely in the search order and grow direction; geometry
69
+ * stays anchored to `markerRowY` at the top.
70
+ */
71
+ export declare function packMarkerRow(entries: MarkerEntity[], chartLeftX: number, chartRightX: number, estimateTextWidth: (text: string, fontSize: number) => number): {
72
+ placements: Map<string, PackedPlacement>;
73
+ rowCount: number;
74
+ };
75
+ export {};
76
+ //# sourceMappingURL=roadmap-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roadmap-node.d.ts","sourceRoot":"","sources":["../../src/nodes/roadmap-node.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACR,eAAe,EACf,WAAW,EACX,aAAa,EACb,mBAAmB,EACtB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gB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