lintje 0.7.0 → 0.8.1
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/NOTICE.md +2 -0
- package/README.md +2 -2
- package/dist-elements/actions.js +1 -1
- package/dist-elements/chat.js +1 -1
- package/dist-elements/chunks/{addon-CFoSG70u.js → addon-BZQerXJg.js} +2 -2
- package/dist-elements/chunks/avatar-BV0HVtpt.js +1 -0
- package/dist-elements/chunks/axes-Dhhfq0h7.js +129 -0
- package/dist-elements/chunks/base-CEzuIIQb.js +226 -0
- package/dist-elements/chunks/chart-styles-BXfNph7G.js +45 -0
- package/dist-elements/chunks/{date-format-5bii3QLP.js → date-format-DvDaZtFc.js} +1 -1
- package/dist-elements/chunks/{dialog-close-CzMRXkJ6.js → dialog-close-DlqfynTX.js} +1 -1
- package/dist-elements/chunks/disclosure-Ch2SwnkG.js +1 -0
- package/dist-elements/chunks/disclosure-Drp0ihys.js +20 -0
- package/dist-elements/chunks/download--CwgcFVi.js +18 -0
- package/dist-elements/chunks/{focus-trap-BDxiHED1.js → focus-trap-Cx3dzqGn.js} +1 -1
- package/dist-elements/chunks/frame-BMR48Vea.js +1 -0
- package/dist-elements/chunks/input-CCT6CcW1.js +1 -0
- package/dist-elements/chunks/{input-C7qx0e4p.js → input-D3fVdkF6.js} +4 -4
- package/dist-elements/chunks/month-grid-B3pzhVAU.js +26 -0
- package/dist-elements/chunks/{other-BaLStKaf.js → other-D3EFrOs_.js} +3 -3
- package/dist-elements/chunks/player-D66x63QC.js +39 -0
- package/dist-elements/chunks/{prose-DOF7h3je.js → prose-aNcSsHId.js} +1 -1
- package/dist-elements/chunks/search-text-i-Em9oIy.js +1 -0
- package/dist-elements/chunks/sentence-BHQlq1yn.js +3 -0
- package/dist-elements/chunks/stagger-Dtq8AS1Y.js +27 -0
- package/dist-elements/chunks/wheel-Co2Dpj0Q.js +1 -0
- package/dist-elements/content.js +1 -1
- package/dist-elements/core.js +1 -1
- package/dist-elements/custom-elements.json +1298 -204
- package/dist-elements/data-types.json +2836 -622
- package/dist-elements/feedback.js +1 -1
- package/dist-elements/graph.d.ts +1 -0
- package/dist-elements/graph.js +1 -0
- package/dist-elements/guides/events.md +7 -3
- package/dist-elements/guides/loading.md +12 -9
- package/dist-elements/layout.js +1 -1
- package/dist-elements/lintje.js +3003 -2247
- package/dist-elements/overlays.js +1 -1
- package/dist-elements/skills/lintje/SKILL.md +26 -5
- package/dist-elements/skills/lintje/check.mjs +180 -0
- package/dist-elements/skills/lintje/reference.mjs +24 -3
- package/dist-elements/tables.js +1 -1
- package/dist-elements/tag/accordion.d.ts +1 -0
- package/dist-elements/tag/accordion.js +6 -0
- package/dist-elements/tag/activity-log.js +13 -11
- package/dist-elements/tag/ai-label.js +5 -5
- package/dist-elements/tag/announcement.js +2 -2
- package/dist-elements/tag/app-search.js +19 -19
- package/dist-elements/tag/attachment.d.ts +1 -0
- package/dist-elements/tag/attachment.js +54 -0
- package/dist-elements/tag/audio-player.js +42 -42
- package/dist-elements/tag/badge.js +1 -1
- package/dist-elements/tag/breadcrumbs.js +8 -8
- package/dist-elements/tag/button.js +1 -1
- package/dist-elements/tag/card-list.js +9 -9
- package/dist-elements/tag/card.js +41 -35
- package/dist-elements/tag/chart.js +682 -419
- package/dist-elements/tag/chat-answer.js +49 -47
- package/dist-elements/tag/chat-composer.js +100 -40
- package/dist-elements/tag/chat-message.js +16 -11
- package/dist-elements/tag/chat-questions.d.ts +1 -0
- package/dist-elements/tag/chat-questions.js +133 -0
- package/dist-elements/tag/chat-steps.d.ts +1 -0
- package/dist-elements/tag/chat-steps.js +52 -0
- package/dist-elements/tag/chat-strip.js +27 -27
- package/dist-elements/tag/chat-suggestions.js +9 -10
- package/dist-elements/tag/chat.js +70 -42
- package/dist-elements/tag/checkbox-group.js +8 -8
- package/dist-elements/tag/checkbox.js +7 -7
- package/dist-elements/tag/code.js +9 -9
- package/dist-elements/tag/combobox.js +22 -22
- package/dist-elements/tag/conflict-alert.js +7 -7
- package/dist-elements/tag/copy-button.js +9 -9
- package/dist-elements/tag/data-table.js +237 -232
- package/dist-elements/tag/date-input.js +15 -39
- package/dist-elements/tag/date-range.js +21 -46
- package/dist-elements/tag/description-list.js +21 -19
- package/dist-elements/tag/dialog.js +7 -7
- package/dist-elements/tag/document-viewer.js +23 -23
- package/dist-elements/tag/drawer.js +9 -9
- package/dist-elements/tag/empty-state.js +1 -1
- package/dist-elements/tag/error-page.js +11 -11
- package/dist-elements/tag/error-summary.js +12 -12
- package/dist-elements/tag/expander.js +5 -5
- package/dist-elements/tag/explainer.js +5 -5
- package/dist-elements/tag/field.js +4 -4
- package/dist-elements/tag/file-upload.js +32 -42
- package/dist-elements/tag/filter-bar.js +20 -20
- package/dist-elements/tag/filter-sheet.js +3 -3
- package/dist-elements/tag/filter-zone.js +15 -15
- package/dist-elements/tag/find.js +16 -16
- package/dist-elements/tag/footer.js +14 -14
- package/dist-elements/tag/form-actions.js +2 -2
- package/dist-elements/tag/form-section.js +3 -3
- package/dist-elements/tag/form.js +3 -3
- package/dist-elements/tag/gallery.js +10 -10
- package/dist-elements/tag/graph.d.ts +1 -0
- package/dist-elements/tag/graph.js +102 -0
- package/dist-elements/tag/grid-item.js +1 -1
- package/dist-elements/tag/grid.js +1 -1
- package/dist-elements/tag/hero.js +7 -7
- package/dist-elements/tag/highlight.js +4 -4
- package/dist-elements/tag/icon-button.js +1 -1
- package/dist-elements/tag/icon.js +1 -1
- package/dist-elements/tag/job-list.js +4 -4
- package/dist-elements/tag/key.d.ts +1 -0
- package/dist-elements/tag/key.js +1 -0
- package/dist-elements/tag/kpi-row.js +5 -5
- package/dist-elements/tag/kpi.js +70 -70
- package/dist-elements/tag/level-meter.js +8 -8
- package/dist-elements/tag/list.js +43 -42
- package/dist-elements/tag/log-viewer.js +68 -68
- package/dist-elements/tag/logo.js +23 -23
- package/dist-elements/tag/map.js +154 -153
- package/dist-elements/tag/menu-button.js +34 -34
- package/dist-elements/tag/modal.js +10 -10
- package/dist-elements/tag/multiselect.js +21 -22
- package/dist-elements/tag/note.js +2 -2
- package/dist-elements/tag/notifications.js +23 -23
- package/dist-elements/tag/number-input.js +18 -18
- package/dist-elements/tag/page-header.js +13 -13
- package/dist-elements/tag/pagination.js +26 -26
- package/dist-elements/tag/person-group.d.ts +1 -0
- package/dist-elements/tag/person-group.js +36 -0
- package/dist-elements/tag/person.d.ts +1 -0
- package/dist-elements/tag/person.js +11 -0
- package/dist-elements/tag/popover.js +1 -1
- package/dist-elements/tag/progress-bar.js +1 -1
- package/dist-elements/tag/prose.js +1 -1
- package/dist-elements/tag/qr-code.js +5 -5
- package/dist-elements/tag/radio-group.js +12 -12
- package/dist-elements/tag/range.js +24 -24
- package/dist-elements/tag/recording-status.js +9 -9
- package/dist-elements/tag/repeater.js +5 -5
- package/dist-elements/tag/segmented.js +8 -8
- package/dist-elements/tag/select.js +8 -8
- package/dist-elements/tag/shell.js +199 -199
- package/dist-elements/tag/skeleton.js +1 -1
- package/dist-elements/tag/slot-picker.js +15 -15
- package/dist-elements/tag/sortable-list.js +20 -20
- package/dist-elements/tag/spinner.js +1 -1
- package/dist-elements/tag/split-pane.js +9 -9
- package/dist-elements/tag/status-dot.js +1 -1
- package/dist-elements/tag/stepper.js +14 -14
- package/dist-elements/tag/streaming-text.js +13 -13
- package/dist-elements/tag/sub-nav.js +20 -20
- package/dist-elements/tag/tabs.js +37 -38
- package/dist-elements/tag/tag-input.js +28 -28
- package/dist-elements/tag/text-editor.js +25 -24
- package/dist-elements/tag/text-input.js +21 -21
- package/dist-elements/tag/textarea.js +11 -11
- package/dist-elements/tag/tile.js +1 -1
- package/dist-elements/tag/time-input.js +13 -13
- package/dist-elements/tag/toast.js +8 -8
- package/dist-elements/tag/toggle.js +5 -5
- package/dist-elements/tag/toggletip.js +6 -6
- package/dist-elements/tag/token-value.js +2 -2
- package/dist-elements/tag/tooltip.js +1 -1
- package/dist-elements/tag/transcript.js +32 -32
- package/dist-elements/tag/translator.js +6 -6
- package/dist-elements/tag/tree-view.js +22 -22
- package/dist-elements/tag/user-menu.js +37 -36
- package/dist-elements/tag/video-player.js +17 -14
- package/dist-elements/tokens.css +52 -1
- package/dist-elements/tokens.json +701 -313
- package/dist-elements/types/bundle/chat.d.ts +2 -0
- package/dist-elements/types/bundle/content.d.ts +2 -0
- package/dist-elements/types/bundle/graph.d.ts +2 -0
- package/dist-elements/types/bundle/index.d.ts +1 -1
- package/dist-elements/types/bundle/layout.d.ts +1 -0
- package/dist-elements/types/bundle/tables.d.ts +2 -0
- package/dist-elements/types/components/charts/chart/chart.d.ts +3 -12
- package/dist-elements/types/components/chat/chat/chat.d.ts +11 -2
- package/dist-elements/types/components/chat/chat-answer/chat-answer.d.ts +6 -4
- package/dist-elements/types/components/chat/chat-composer/chat-composer.d.ts +61 -4
- package/dist-elements/types/components/chat/chat-message/chat-message.d.ts +6 -2
- package/dist-elements/types/components/chat/chat-questions/chat-questions.d.ts +106 -0
- package/dist-elements/types/components/chat/chat-steps/chat-steps.d.ts +53 -0
- package/dist-elements/types/components/chat/chat-suggestions/chat-suggestions.d.ts +4 -11
- package/dist-elements/types/components/content/attachment/attachment.d.ts +58 -0
- package/dist-elements/types/components/content/audio-player/audio-player.d.ts +2 -1
- package/dist-elements/types/components/content/key/key.d.ts +21 -0
- package/dist-elements/types/components/content/prose/prose.d.ts +4 -3
- package/dist-elements/types/components/content/shared/player.d.ts +2 -1
- package/dist-elements/types/components/content/transcript/transcript.d.ts +7 -0
- package/dist-elements/types/components/content/video-player/video-player.d.ts +12 -3
- package/dist-elements/types/components/feedback/empty-state/empty-state.d.ts +2 -2
- package/dist-elements/types/components/feedback/status-dot/status-dot.d.ts +13 -2
- package/dist-elements/types/components/forms/form-actions/form-actions.d.ts +5 -2
- package/dist-elements/types/components/frame/app-search/app-search.d.ts +0 -2
- package/dist-elements/types/components/frame/user-menu/user-menu.d.ts +2 -2
- package/dist-elements/types/components/graph/graph/graph.d.ts +147 -0
- package/dist-elements/types/components/graph/graph/layout-runner.d.ts +13 -0
- package/dist-elements/types/components/graph/graph/layout-worker.d.ts +1 -0
- package/dist-elements/types/components/graph/graph/layout.d.ts +27 -0
- package/dist-elements/types/components/graph/graph/model.d.ts +81 -0
- package/dist-elements/types/components/graph/graph/routes.d.ts +62 -0
- package/dist-elements/types/components/graph/graph/view.d.ts +58 -0
- package/dist-elements/types/components/index.d.ts +20 -4
- package/dist-elements/types/components/inputs/combobox/combobox.d.ts +0 -2
- package/dist-elements/types/components/inputs/date-input/date-input.d.ts +1 -1
- package/dist-elements/types/components/inputs/date-range/date-range.d.ts +17 -6
- package/dist-elements/types/components/inputs/file-upload/file-upload.d.ts +10 -33
- package/dist-elements/types/components/inputs/multiselect/multiselect.d.ts +1 -11
- package/dist-elements/types/components/layout/accordion/accordion.d.ts +37 -0
- package/dist-elements/types/components/layout/expander/expander.d.ts +5 -1
- package/dist-elements/types/components/layout/split-pane/split-pane.d.ts +2 -0
- package/dist-elements/types/components/layout/tabs/tabs.d.ts +3 -0
- package/dist-elements/types/components/overlays/popover/popover.d.ts +7 -0
- package/dist-elements/types/components/overlays/tooltip/tooltip.d.ts +1 -1
- package/dist-elements/types/components/shared/avatar.d.ts +21 -0
- package/dist-elements/types/components/shared/charts/bar-chart/bar-chart.d.ts +3 -2
- package/dist-elements/types/components/shared/charts/dumbbell-chart/dumbbell-chart.d.ts +33 -0
- package/dist-elements/types/components/shared/charts/index.d.ts +6 -2
- package/dist-elements/types/components/shared/charts/kinds.d.ts +22 -4
- package/dist-elements/types/components/shared/charts/line-chart/line-chart.d.ts +3 -2
- package/dist-elements/types/components/shared/charts/sankey-chart/sankey-chart.d.ts +124 -0
- package/dist-elements/types/components/shared/charts/shared/axes.d.ts +33 -6
- package/dist-elements/types/components/shared/charts/shared/chart-states.d.ts +1 -1
- package/dist-elements/types/components/shared/charts/shared/chart-styles.d.ts +2 -0
- package/dist-elements/types/components/shared/charts/shared/colors.d.ts +29 -4
- package/dist-elements/types/components/shared/charts/shared/controller.d.ts +23 -3
- package/dist-elements/types/components/shared/charts/shared/forecast.d.ts +21 -0
- package/dist-elements/types/components/shared/charts/shared/plot-keys.d.ts +5 -0
- package/dist-elements/types/components/shared/charts/shared/tints.d.ts +2 -0
- package/dist-elements/types/components/shared/charts/shared/types.d.ts +146 -0
- package/dist-elements/types/components/shared/charts/shared/wheel.d.ts +11 -0
- package/dist-elements/types/components/shared/charts/treemap-chart/squarify.d.ts +16 -0
- package/dist-elements/types/components/shared/charts/treemap-chart/treemap-chart.d.ts +18 -0
- package/dist-elements/types/components/shared/charts/treemap-chart/treemap-labels.d.ts +36 -0
- package/dist-elements/types/components/shared/charts/treemap-chart/treemap-parts.d.ts +64 -0
- package/dist-elements/types/components/shared/disclosure.d.ts +5 -3
- package/dist-elements/types/components/shared/download.d.ts +28 -2
- package/dist-elements/types/components/shared/empty-state-block.d.ts +1 -1
- package/dist-elements/types/components/shared/files.d.ts +67 -0
- package/dist-elements/types/components/shared/heading.d.ts +4 -0
- package/dist-elements/types/components/shared/month-grid.d.ts +33 -0
- package/dist-elements/types/components/shared/place.d.ts +2 -2
- package/dist-elements/types/components/shared/search-text.d.ts +5 -0
- package/dist-elements/types/components/tables/activity-log/activity-log.d.ts +9 -2
- package/dist-elements/types/components/tables/card/card.d.ts +13 -2
- package/dist-elements/types/components/tables/data-table/editing.d.ts +7 -2
- package/dist-elements/types/components/tables/description-list/description-list.d.ts +4 -0
- package/dist-elements/types/components/tables/list/list.d.ts +9 -0
- package/dist-elements/types/components/tables/person/person.d.ts +35 -0
- package/dist-elements/types/components/tables/person-group/person-group.d.ts +42 -0
- package/dist-elements/types/core/format.d.ts +2 -2
- package/dist-elements/types/core/id.d.ts +2 -0
- package/dist-elements/types/icons/register.d.ts +1 -1
- package/dist-elements/types/types.d.ts +194 -15
- package/dist-elements/workers/layout-worker.js +3 -0
- package/dist-icons/functioneel-link.svg +1 -0
- package/dist-icons/functioneel-ondertiteling.svg +1 -0
- package/package.json +8 -1
- package/dist-elements/chunks/base-BsZyWDre.js +0 -226
- package/dist-elements/chunks/chart-styles-C5IzbVUF.js +0 -44
- package/dist-elements/chunks/disclosure-CQcLUnKh.js +0 -22
- package/dist-elements/chunks/disclosure-DjLQzn9n.js +0 -1
- package/dist-elements/chunks/download-CxEzwMxI.js +0 -13
- package/dist-elements/chunks/input-CazTpGUd.js +0 -1
- package/dist-elements/chunks/player-BEG3MVCm.js +0 -39
- package/dist-elements/chunks/sentence-CjgQjBP9.js +0 -3
- package/dist-elements/chunks/stagger-CwsMNTLl.js +0 -133
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
* names come from their one list, `tokens/colors.ts`.
|
|
6
6
|
*/
|
|
7
7
|
import type { DataColor } from './tokens/colors.js';
|
|
8
|
-
import type { ContentStateKind, Tone } from './components/shared/tone.js';
|
|
8
|
+
import type { ContentStateKind, Tone, WorkState } from './components/shared/tone.js';
|
|
9
9
|
import type { StatusTone } from './components/feedback/status-dot/status-dot.js';
|
|
10
10
|
import type { AnnouncementKind } from './components/shared/announcement-block.js';
|
|
11
11
|
import type { ChartSpec, MapSpec } from './components/shared/charts/shared/types.js';
|
|
12
12
|
import type { MenuEntry } from './components/actions/menu-button/menu-button.js';
|
|
13
13
|
import type { NotificationItem } from './components/frame/notifications/notifications.js';
|
|
14
|
-
|
|
14
|
+
import type { UploadFile } from './components/shared/files.js';
|
|
15
|
+
export type { BarSeriesData, ChartColor, ChartEvent, ChartForecast, ChartKind, ChartSpec, LineSeriesData, MapSpec, MapValue, MapSeriesKey, MapSeriesColor, MapSeriesStyle, MapPlotData, MapPlotVariant, MapVariant, ScatterPoint, SankeyFlow, SankeyNode, SankeyStep, ScatterSeriesData, DumbbellRow, WmsBasemap, MapArea, MapControls, RadarSeriesData, TreemapPart, TreemapSubPart, } from './components/shared/charts/shared/types.js';
|
|
15
16
|
export type { SeriesShape } from './components/shared/charts/shared/series-shapes.js';
|
|
16
17
|
export type { DataColor } from './tokens/colors.js';
|
|
17
18
|
export type { Tone, WorkState, ContentStateKind } from './components/shared/tone.js';
|
|
@@ -135,8 +136,6 @@ export interface ChartData extends FrameSettings, TileData, ContentState {
|
|
|
135
136
|
selectedId?: string | null;
|
|
136
137
|
/** The URL that undoes the selection; clicking the chosen mark again and Escape follow it. */
|
|
137
138
|
clearHref?: string;
|
|
138
|
-
/** Offers "Grafiek" / "Tabel" in the header while `ready`; the table shows the CSV's rows. */
|
|
139
|
-
tableSwitch?: boolean;
|
|
140
139
|
}
|
|
141
140
|
/**
|
|
142
141
|
* Events: `lintje-mark-select` `{id, label, href?}` on a click on an area or point,
|
|
@@ -147,6 +146,82 @@ export interface ChartData extends FrameSettings, TileData, ContentState {
|
|
|
147
146
|
*/
|
|
148
147
|
export interface MapData extends FrameSettings, TileData, ContentState, MapSpec {
|
|
149
148
|
}
|
|
149
|
+
/** A kind of node: its words, its icon and its data colour. */
|
|
150
|
+
export interface GraphNodeType {
|
|
151
|
+
/** What a node's `type` names. */
|
|
152
|
+
key: string;
|
|
153
|
+
/** The kind in words, singular: "Persoon". */
|
|
154
|
+
label: string;
|
|
155
|
+
/** The kind in words, plural, which names a group of them: "Personen". Without it `label`. */
|
|
156
|
+
plural?: string;
|
|
157
|
+
/** An icon file name (`dist-icons/`, without `.svg`). */
|
|
158
|
+
icon: string;
|
|
159
|
+
/** The kind's data colour; without it the colour of its place in `types`. */
|
|
160
|
+
color?: DataColor;
|
|
161
|
+
}
|
|
162
|
+
/** A state of a node in words, with the tone its dot takes: "geldend", "vervallen". */
|
|
163
|
+
export interface GraphNodeStatus {
|
|
164
|
+
label: string;
|
|
165
|
+
/** Default `neutral`. */
|
|
166
|
+
tone?: Tone;
|
|
167
|
+
}
|
|
168
|
+
export interface GraphNode {
|
|
169
|
+
id: string;
|
|
170
|
+
label: string;
|
|
171
|
+
/** The `key` of its type. */
|
|
172
|
+
type: string;
|
|
173
|
+
status?: GraphNodeStatus;
|
|
174
|
+
/** Drawn in a circle instead of the type's icon, for a person. */
|
|
175
|
+
initials?: string;
|
|
176
|
+
/** How many relations the host has not loaded yet; its counter asks for them. */
|
|
177
|
+
more?: number;
|
|
178
|
+
}
|
|
179
|
+
/** `to`: an arrowhead at `to`; `both`: at both ends; `none`: a relation without direction. */
|
|
180
|
+
export type GraphDirection = 'to' | 'both' | 'none';
|
|
181
|
+
export interface GraphEdge {
|
|
182
|
+
from: string;
|
|
183
|
+
to: string;
|
|
184
|
+
/** The relation's word, on the line: "aanvrager", "werkt bij". */
|
|
185
|
+
label?: string;
|
|
186
|
+
/** Default `to`. */
|
|
187
|
+
direction?: GraphDirection;
|
|
188
|
+
/** A number the line's thickness shows, from 1.5 to 4 px over the largest of the graph. */
|
|
189
|
+
value?: number;
|
|
190
|
+
/** The number's unit, after it in the tooltip: "records per dag". */
|
|
191
|
+
unit?: string;
|
|
192
|
+
}
|
|
193
|
+
/** Layered to the right or downwards, by force, or in rings round the centre. */
|
|
194
|
+
export type GraphLayout = 'layered-right' | 'layered-down' | 'force' | 'radial';
|
|
195
|
+
/** `orthogonal` draws a layered graph in right angles; elsewhere it is straight. */
|
|
196
|
+
export type GraphLines = 'straight' | 'curved' | 'orthogonal';
|
|
197
|
+
/**
|
|
198
|
+
* Events: `lintje-node-select` `{id, label}` for a chosen node, `{id: null, label: null}` when
|
|
199
|
+
* undone; `lintje-node-toggle` `{id, open}` when a branch or a group is opened or folded, one per
|
|
200
|
+
* node when the reset button sets it all back; `lintje-node-expand` `{id}` when a node with `more`
|
|
201
|
+
* is opened. With `download` the tile offers the drawing as a PNG.
|
|
202
|
+
*/
|
|
203
|
+
export interface GraphData extends FrameSettings, TileData, ContentState {
|
|
204
|
+
/** The kinds in the order the legend and the colours take them. */
|
|
205
|
+
types: GraphNodeType[];
|
|
206
|
+
nodes: GraphNode[];
|
|
207
|
+
edges: GraphEdge[];
|
|
208
|
+
/** The drawing's `<desc>`: what the graph shows, the accessible alternative. Required. */
|
|
209
|
+
description: string;
|
|
210
|
+
/** Without it the element chooses by the graph's shape. */
|
|
211
|
+
layout?: GraphLayout;
|
|
212
|
+
/** Without it straight, and curved round the centre in `radial`. */
|
|
213
|
+
lines?: GraphLines;
|
|
214
|
+
/** The chosen node: outlined, its relations and neighbours lit, the rest stepped back. */
|
|
215
|
+
selected?: string | null;
|
|
216
|
+
/** Nodes whose branch is folded. */
|
|
217
|
+
collapsed?: string[];
|
|
218
|
+
/** Groups the reader opened, by the id `lintje-node-toggle` gave them. */
|
|
219
|
+
opened?: string[];
|
|
220
|
+
/** Draws each kind's icon and mark in its data colour; default true. */
|
|
221
|
+
typeColors?: boolean;
|
|
222
|
+
/** The drawing's height in px; without it 480, and 360 on a phone. */
|
|
223
|
+
height?: number;
|
|
224
|
+
}
|
|
150
225
|
export type CellValue = string | number | null;
|
|
151
226
|
export interface TableColumnData {
|
|
152
227
|
key: string;
|
|
@@ -165,8 +240,9 @@ export interface TableColumnData {
|
|
|
165
240
|
* reader hears them, and below 768 px the row's measure shows the change whole.
|
|
166
241
|
* `status`: a `StatusTone` (or mapped through `status.tones`) as the status dot with its label.
|
|
167
242
|
* `label`: the value as a badge with the word, tone and icon from `labels`.
|
|
243
|
+
* `person`: the value is an id in `people`, drawn as `lintje-person`.
|
|
168
244
|
*/
|
|
169
|
-
format?: 'text' | 'number' | 'percent' | 'decimal' | 'change' | 'change-compact' | 'status' | 'label';
|
|
245
|
+
format?: 'text' | 'number' | 'percent' | 'decimal' | 'change' | 'change-compact' | 'status' | 'label' | 'person';
|
|
170
246
|
/**
|
|
171
247
|
* `change-compact`: the words the glyph stands for, as a template with `{key}` placeholders
|
|
172
248
|
* filled from the row, each value read the way its column reads it (`{change}` gives
|
|
@@ -194,6 +270,13 @@ export interface TableColumnData {
|
|
|
194
270
|
* value without an entry stands as plain text. Sorting and the CSV use the word.
|
|
195
271
|
*/
|
|
196
272
|
labels?: Record<string, TableLabel>;
|
|
273
|
+
/**
|
|
274
|
+
* `person` format: value → the person it stands for, as `labels` does for a label. An id without
|
|
275
|
+
* an entry stands as plain text. Sorting, filtering and the CSV use the name.
|
|
276
|
+
*/
|
|
277
|
+
people?: Record<string, Person>;
|
|
278
|
+
/** `person` format: the word for `null`; default "Niet toegewezen". */
|
|
279
|
+
empty?: string;
|
|
197
280
|
/** Shown muted instead of an exact 0, where 0 means "none" (e.g. "—"). Missing stays `null`. */
|
|
198
281
|
zeroText?: string;
|
|
199
282
|
mobileSubline?: boolean;
|
|
@@ -501,12 +584,20 @@ export interface ShellGroup {
|
|
|
501
584
|
label: string;
|
|
502
585
|
links: ShellLink[];
|
|
503
586
|
}
|
|
504
|
-
|
|
587
|
+
/** A person as an element shows them. */
|
|
588
|
+
export interface Person {
|
|
505
589
|
name: string;
|
|
506
|
-
/**
|
|
590
|
+
/** Written by the host ("JV"): initials are not derived, "J. de Vries" has no rule. */
|
|
591
|
+
initials?: string;
|
|
592
|
+
/** The second line: function or department ("Senior behandelaar"). */
|
|
507
593
|
role?: string;
|
|
508
|
-
initials
|
|
594
|
+
/** A photo, cropped to the circle; when it does not load, the initials. */
|
|
595
|
+
photo?: string;
|
|
596
|
+
/** Makes the name a link to a profile. */
|
|
597
|
+
href?: string;
|
|
509
598
|
}
|
|
599
|
+
/** The person in the user menu: unchanged for every host that sets it. */
|
|
600
|
+
export type UserMenuUser = Person;
|
|
510
601
|
/** The light/dark setting as the reader chose it; `system` follows `prefers-color-scheme`. */
|
|
511
602
|
export type ModeSetting = 'system' | 'light' | 'dark';
|
|
512
603
|
/** The reader's display settings, as the host holds them; with them the bar has "Weergave". */
|
|
@@ -638,10 +729,13 @@ export interface ChatTermRange {
|
|
|
638
729
|
certain?: boolean;
|
|
639
730
|
}
|
|
640
731
|
export interface ChatMessageData {
|
|
732
|
+
/** `''` for a message that is only its attachments. */
|
|
641
733
|
text: string;
|
|
642
734
|
terms?: ChatTermRange[];
|
|
643
735
|
/** When it was sent, as the host formats it ("08:20"). */
|
|
644
736
|
time?: string;
|
|
737
|
+
/** What was sent along with the question; always `state: 'done'`. */
|
|
738
|
+
attachments?: UploadFile[];
|
|
645
739
|
}
|
|
646
740
|
export interface ChatSuggestion {
|
|
647
741
|
label: string;
|
|
@@ -682,7 +776,72 @@ export type ChatBlock = {
|
|
|
682
776
|
} | {
|
|
683
777
|
kind: 'data-table';
|
|
684
778
|
data: DataTableData;
|
|
779
|
+
}
|
|
780
|
+
/** Files the answer gives back or cites, beside the sentence that names them. */
|
|
781
|
+
| {
|
|
782
|
+
kind: 'attachments';
|
|
783
|
+
items: UploadFile[];
|
|
685
784
|
};
|
|
785
|
+
/** One thing the assistant did for an answer. The host writes the label in its own tense and
|
|
786
|
+
* with its outcome: "3 bronnen doorzoeken" while busy, "3 bronnen doorzocht" when done,
|
|
787
|
+
* "Tabel ophalen mislukt" or "Tabel ophalen gestopt". */
|
|
788
|
+
export interface ChatStep {
|
|
789
|
+
label: string;
|
|
790
|
+
/** `done` without it. */
|
|
791
|
+
state?: Extract<WorkState, 'busy' | 'done' | 'error' | 'cancelled'>;
|
|
792
|
+
/** Short, after the label on the same line: the sources, the table, or why it failed. */
|
|
793
|
+
detail?: string;
|
|
794
|
+
/** Makes `linkText` in the detail a link: the source's page. */
|
|
795
|
+
href?: string;
|
|
796
|
+
/** Without it, or when the detail does not hold it, the whole detail is the link. */
|
|
797
|
+
linkText?: string;
|
|
798
|
+
}
|
|
799
|
+
/** What the assistant did for one answer, oldest first; steps are only ever added at the end. */
|
|
800
|
+
export interface ChatStepsData {
|
|
801
|
+
items: ChatStep[];
|
|
802
|
+
/** How long it took, as the host formats it ("12 s"). Only once nothing is busy: while a step
|
|
803
|
+
* runs, it is not drawn. */
|
|
804
|
+
duration?: string;
|
|
805
|
+
}
|
|
806
|
+
/** A line between turns, above the question of its turn. */
|
|
807
|
+
export interface ChatDivider {
|
|
808
|
+
/** `time` ("Gisteren") and `topic` ("Nieuw onderwerp") are quiet; `context`: the conversation
|
|
809
|
+
* was trimmed, and what stands above is no longer used. `time` without it. */
|
|
810
|
+
kind?: 'time' | 'topic' | 'context';
|
|
811
|
+
label: string;
|
|
812
|
+
/** One sentence under the label. A `context` divider without it says "De assistent neemt de
|
|
813
|
+
* vragen hierboven niet meer mee." */
|
|
814
|
+
note?: string;
|
|
815
|
+
}
|
|
816
|
+
export type ChatQuestionKind = 'one' | 'many' | 'text';
|
|
817
|
+
/** One question the assistant asks before it answers. */
|
|
818
|
+
export interface ChatQuestion {
|
|
819
|
+
id: string;
|
|
820
|
+
/** The short name in the progress line and the reader's message: "Periode". */
|
|
821
|
+
label: string;
|
|
822
|
+
/** The question itself: "Welke periode bedoel je?" */
|
|
823
|
+
text: string;
|
|
824
|
+
kind: ChatQuestionKind;
|
|
825
|
+
/** `one` and `many`; a `description` stands under its label. "Iets anders…" always follows. */
|
|
826
|
+
options?: FilterOption[];
|
|
827
|
+
/** The placeholder of the "Iets anders…" field. */
|
|
828
|
+
otherPlaceholder?: string;
|
|
829
|
+
/** Marks "(niet verplicht)" and offers Overslaan; a question is required without it. */
|
|
830
|
+
optional?: boolean;
|
|
831
|
+
hint?: string;
|
|
832
|
+
/** `text`: the field's placeholder. */
|
|
833
|
+
placeholder?: string;
|
|
834
|
+
/** The message when a required question has no answer; "Kies een antwoord." without it
|
|
835
|
+
* ("Vul een antwoord in." for `text`). */
|
|
836
|
+
error?: string;
|
|
837
|
+
}
|
|
838
|
+
/** What the assistant asks before it answers: `lintje-chat-questions`. */
|
|
839
|
+
export interface ChatQuestionsData {
|
|
840
|
+
/** 1 to 5. One `one` question without descriptions is drawn in the short form. */
|
|
841
|
+
questions: ChatQuestion[];
|
|
842
|
+
/** `sending`: the answers are on their way. */
|
|
843
|
+
state?: 'open' | 'sending';
|
|
844
|
+
}
|
|
686
845
|
/** Where an answer stands. `out-of-scope` needs a source on; `needs-clarification` asks back. */
|
|
687
846
|
export type ChatAnswerState = 'ready' | 'streaming' | 'stopped' | 'error' | 'out-of-scope' | 'needs-clarification';
|
|
688
847
|
/** What the assistant answered: `lintje-chat-answer`. */
|
|
@@ -692,20 +851,28 @@ export interface ChatAnswerData {
|
|
|
692
851
|
text?: string;
|
|
693
852
|
blocks?: ChatBlock[];
|
|
694
853
|
strip?: ChatStripData;
|
|
695
|
-
/** `streaming`: the step that is running ("Cijfers berekenen · stap 2 van 3").
|
|
854
|
+
/** `streaming`: the step that is running ("Cijfers berekenen · stap 2 van 3"). With `steps`,
|
|
855
|
+
* the running step says it and `status` is not drawn. */
|
|
696
856
|
status?: string;
|
|
857
|
+
/** What the assistant did for this answer, above its text in every state. */
|
|
858
|
+
steps?: ChatStepsData;
|
|
697
859
|
/** `error`: what went wrong, and the way out in words. */
|
|
698
860
|
error?: {
|
|
699
861
|
title?: string;
|
|
700
862
|
text: string;
|
|
701
863
|
};
|
|
702
|
-
/**
|
|
703
|
-
|
|
864
|
+
/**
|
|
865
|
+
* `needs-clarification` and `out-of-scope`: what the assistant asks before it answers, in a box
|
|
866
|
+
* above the question box. Counts on the last answer only; a new turn ends it.
|
|
867
|
+
*/
|
|
868
|
+
questions?: ChatQuestionsData;
|
|
704
869
|
/** Suggested next questions, dashed. Drawn under the last answer only. */
|
|
705
870
|
followUps?: ChatSuggestion[];
|
|
706
871
|
}
|
|
707
872
|
export interface ChatTurnData {
|
|
708
873
|
id: string;
|
|
874
|
+
/** The line above this turn's question: "Gisteren", "Nieuw onderwerp", "Gesprek ingekort". */
|
|
875
|
+
divider?: ChatDivider;
|
|
709
876
|
message: ChatMessageData;
|
|
710
877
|
answer?: ChatAnswerData;
|
|
711
878
|
}
|
|
@@ -741,9 +908,11 @@ export interface ChatStartData {
|
|
|
741
908
|
}
|
|
742
909
|
/**
|
|
743
910
|
* The host owns the conversation and sets `data` again on change.
|
|
744
|
-
* Events: `lintje-message-send`, `lintje-answer
|
|
745
|
-
* `lintje-draft-change`, `lintje-suggestion-select`, `lintje-message-edit`,
|
|
746
|
-
* `lintje-answer-retry`, `lintje-answer-rate`, `lintje-strip-change`,
|
|
911
|
+
* Events: `lintje-message-send`, `lintje-questions-answer`, `lintje-answer-stop`,
|
|
912
|
+
* `lintje-sources-change`, `lintje-draft-change`, `lintje-suggestion-select`, `lintje-message-edit`,
|
|
913
|
+
* `lintje-answer-retry`, `lintje-answer-rate`, `lintje-strip-change`, the attachments'
|
|
914
|
+
* `lintje-files-add`, `lintje-file-remove`, `lintje-file-cancel`, `lintje-file-retry` and
|
|
915
|
+
* `lintje-file-open`, `lintje-navigate` from a link in a step, and the blocks' own
|
|
747
916
|
* `lintje-mark-select`, `lintje-row-click` and `lintje-sort-change`.
|
|
748
917
|
*/
|
|
749
918
|
export interface ChatData extends FrameSettings {
|
|
@@ -755,11 +924,21 @@ export interface ChatData extends FrameSettings {
|
|
|
755
924
|
draftTerms?: ChatDraftTerms;
|
|
756
925
|
/** The question box's placeholder; "Stel een vraag over de gegevens" without it. */
|
|
757
926
|
placeholder?: string;
|
|
927
|
+
/**
|
|
928
|
+
* Files sent along with a question: the paperclip, dragging and pasting. Without it the box
|
|
929
|
+
* takes no files. `files` are those of the question still being typed; the host keeps them.
|
|
930
|
+
*/
|
|
931
|
+
upload?: {
|
|
932
|
+
accept?: string;
|
|
933
|
+
maxSize?: number;
|
|
934
|
+
files?: UploadFile[];
|
|
935
|
+
};
|
|
758
936
|
}
|
|
759
937
|
export type { FormValues, FormErrors, StoredDraft } from './components/forms/form/form.js';
|
|
760
938
|
export type { ErrorSummaryItem } from './components/forms/error-summary/error-summary.js';
|
|
939
|
+
export type { ChatQuestionAnswer } from './components/chat/chat-questions/chat-questions.js';
|
|
761
940
|
export type { ErrorPageLink } from './components/feedback/error-page/error-page.js';
|
|
762
|
-
export type { UploadFile } from './components/
|
|
941
|
+
export type { UploadFile } from './components/shared/files.js';
|
|
763
942
|
export type { DateRange } from './components/inputs/date-range/date-range.js';
|
|
764
943
|
export type { SlotDay, TimeSlot } from './components/inputs/slot-picker/slot-picker.js';
|
|
765
944
|
export type { TabItem } from './components/layout/tabs/tabs.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var e=Object.defineProperty,t=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,n=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})},r=(e,n,r)=>t(e,typeof n==`symbol`?n:n+``,r),i={};n(i,{Graph:()=>C,alg:()=>_});var a=Object.defineProperty,o=(e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},s=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=typeof e==`function`?e:()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t),r=this.successors(e);if(r)for(let e of r)n.add(e);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),(t?.length??0)===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i,i):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=typeof e==`function`?e:()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,l=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,l=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,l=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let f=u(this._isDirected,i,a,o);if(f in this._edgeLabels)return l&&(this._edgeLabels[f]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[f]=l?s:this._defaultEdgeLabelFn(i,a,o);let p=d(this._isDirected,i,a,o);return i=p.v,a=p.w,Object.freeze(p),this._edgeObjs[f]=p,c(this._preds[a],i),c(this._sucs[i],a),this._in[a][f]=p,this._out[i][f]=p,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?f(this._isDirected,e):u(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!=`object`||!r?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?f(this._isDirected,e):u(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?f(this._isDirected,e):u(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],l(this._preds[t],e),l(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function c(e,t){e[t]?e[t]++:e[t]=1}function l(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function u(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function d(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function f(e,t){return u(e,t.v,t.w,t.name)}o({},{read:()=>g,write:()=>p});function p(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:m(e),edges:h(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function m(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function h(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function g(e){let t=new s(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var _={};o(_,{CycleException:()=>S,bellmanFord:()=>y,components:()=>b,dijkstra:()=>x,dijkstraAll:()=>ie,findCycles:()=>oe,floydWarshall:()=>ce,isAcyclic:()=>de,postorder:()=>he,preorder:()=>ge,prim:()=>_e,shortestPaths:()=>ve,tarjan:()=>ae,topsort:()=>ue});var v=()=>1;function y(e,t,n,r){return ee(e,String(t),n||v,r||function(t){return e.outEdges(t)??[]})}function ee(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=i[e.v],r=i[e.w];if(!t||!r)return;let o=n(e);t.distance+o<r.distance&&(i[e.w]={distance:t.distance+o,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){let n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;c({v:n,w:r})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0,predecessor:``}});let u=s.length;for(let e=1;e<u&&(a=!1,o++,l(),a);e++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}function b(e){let t={},n=[],r;function i(n){var a,o;n in t||(t[n]=!0,r.push(n),(a=e.successors(n))==null||a.forEach(i),(o=e.predecessors(n))==null||o.forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}var te=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){if(this.size()===0)throw Error(`Queue underflow`);this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}},ne=()=>1;function x(e,t,n,r){return re(e,String(t),n||ne,r||function(t){return e.outEdges(t)??[]})}function re(e,t,n,r){let i={},a=new te,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t];if(!r)return;let c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l<r.distance&&(r.distance=l,r.predecessor=o,a.decrease(t,l))};for(e.nodes().forEach(function(e){let n=e===t?0:1/0;i[e]={distance:n,predecessor:``},a.add(e,n)});a.size()>0;){o=a.removeMin();let e=i[o];if(!e||e.distance===1/0)break;s=e,r(o).forEach(c)}return i}function ie(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=x(e,i,t,n),r},{})}function ae(e){let t=0,n=[],r={},i=[];function a(o){var s;let c=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),(s=e.successors(o))==null||s.forEach(function(e){if(e in r){let t=r[e];t!=null&&t.onStack&&(c.lowlink=Math.min(c.lowlink,t.index))}else{a(e);let t=r[e];t&&(c.lowlink=Math.min(c.lowlink,t.lowlink))}}),c.lowlink===c.index){let e=[],t;do{t=n.pop();let i=r[t];i&&(i.onStack=!1),e.push(t)}while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function oe(e){return ae(e).filter(function(t){let n=t[0];return n?t.length>1||t.length===1&&(e.outEdges(n,n)??[]).length>0:!1})}var se=()=>1;function ce(e,t,n){return le(e,t||se,n||function(t){return e.outEdges(t)??[]})}function le(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){let a={};r[e]=a,a[e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(a[t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let r=n.v===e?n.w:n.v,i=t(n);a[r]={distance:i,predecessor:e}})}),i.forEach(function(e){let t=r[e];t&&i.forEach(function(n){let a=r[n];a&&i.forEach(function(n){let r=a[e],i=t[n],o=a[n];if(r&&i&&o){let e=r.distance+i.distance;e<o.distance&&(o.distance=e,o.predecessor=i.predecessor)}})})}),r}var S=class extends Error{constructor(e){super(e),this.name=`CycleException`}};function ue(e){let t={},n={},r=[];function i(a){var o;if(a in n)throw new S;a in t||(n[a]=!0,t[a]=!0,(o=e.predecessors(a))==null||o.forEach(i),delete n[a],r.push(a))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new S;return r}function de(e){try{ue(e)}catch(e){if(e instanceof S)return!1;throw e}return!0}function fe(e,t,n,r,i){Array.isArray(t)||(t=[t]);let a=(t=>(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=pe(e,t,n===`post`,o,a,r,i)}),i}function pe(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=pe(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function me(e,t,n){return fe(e,t,n,function(e,t){return e.push(t),e},[])}function he(e,t){return me(e,t,`post`)}function ge(e,t){return me(e,t,`pre`)}function _e(e,t){var n;let r=new s,i={},a=new te,o;function c(e){let n=e.v===o?e.w:e.v,r=a.priority(n);if(r!==void 0){let s=t(e);s<r&&(i[n]=o,a.decrease(n,s))}}if(e.nodeCount()===0)return r;e.nodes().forEach(function(e){a.add(e,1/0),r.setNode(e)});let l=e.nodes()[0];l!==void 0&&a.decrease(l,0);let u=!1;for(;a.size()>0;){if(o=a.removeMin(),o in i)r.setEdge(o,i[o]);else{if(u)throw Error(`Input graph is not connected: `+e);u=!0}(n=e.nodeEdges(o))==null||n.forEach(c)}return r}function ve(e,t,n,r){return ye(e,t,n,r??(t=>e.outEdges(t)??[]))}function ye(e,t,n,r){if(n===void 0)return x(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;o<a.length;o++){let s=a[o];if(s===void 0)continue;let c=r(s);for(let e=0;e<c.length;e++){let t=c[e];if(!t)continue;let r=t.v===s?t.v:t.w;n({v:r,w:r===t.v?t.w:t.v})<0&&(i=!0)}if(i)return y(e,t,n,r)}return x(e,t,n,r)}var C=s;function w(e,t,n,r){let i=r;for(;e.hasNode(i);)i=Me(r);return n.dummy=t,e.setNode(i,n),i}function be(e){let t=new C().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function xe(e){let t=new C({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function Se(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function T(e){let t=D(Oe(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function Ce(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=E(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function we(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=E(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function Te(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),w(e,`border`,i,t)}function Ee(e,t=De){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var De=65535;function E(e,t){return t.length>De?e(...Ee(t).map(t=>e(...t))):e(...t)}function Oe(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return E(Math.max,t)}function ke(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function Ae(e,t){return t()}var je=0;function Me(e){return e+(``+ ++je)}function D(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function O(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function k(e,t){let n;return n=typeof t==`string`?e=>e[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function Ne(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var A=`\0`;function Pe(e,t,n){if(!(e&&t&&n&&t.dummy===`edge`&&n.dummy===`edge`&&t.edgeObj&&n.edgeObj&&e[t.edgeObj.v]&&e[n.edgeObj.v]&&e[t.edgeObj.w]&&e[n.edgeObj.w]))return 0;let r=!0;t.edgeObj.w===n.edgeObj.w&&(r=!1);let i=r?e[t.edgeObj.v]?.rank??NaN:e[t.edgeObj.w]?.rank??NaN,a=Object.entries(e).find(e=>e[1].edgeObj?.v===t.edgeObj.v&&e[1].edgeObj?.w===t.edgeObj.w&&e[1].rank===i),o=Object.entries(e).find(e=>e[1].edgeObj?.v===n.edgeObj.v&&e[1].edgeObj?.w===n.edgeObj.w&&e[1].rank===i);if(!a||!o)return 0;let s=a[1].order??NaN,c=o[1].order??NaN;return isNaN(s-c)?0:s-c}var Fe=class{constructor(){r(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return Ie(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&Ie(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,Le)),n=n._prev;return`[`+e.join(`, `)+`]`}};function Ie(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Le(e,t){if(e!==`_next`&&e!==`_prev`)return t}var Re=Fe,ze=()=>1;function Be(e,t){if(e.nodeCount()<=1)return[];let n=Ue(e,t||ze);return Ve(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function Ve(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)He(e,t,n,o);for(;o=i.dequeue();)He(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(He(e,t,n,o,!0)||[]);break}}}return r}function He(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,We(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,We(t,n,o)}),e.removeNode(r.v),o}function Ue(e,t){let n=new C,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=Ge(i+r+3).map(()=>new Re),o=r+1;return n.nodes().forEach(e=>{We(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function We(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function Ge(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function Ke(e,t){(e.graph().acyclicer===`greedy`?Be(e,n(e)):qe(e,t??null)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,Me(`rev`))});function n(e){return t=>e.edge(t).weight}}function qe(e,t){let n=[],r={},i={};function a(t){Object.hasOwn(i,t)||(i[t]=!0,r[t]=!0,e.outEdges(t).forEach(e=>{Object.hasOwn(r,e.w)?n.push(e):a(e.w)}),delete r[t])}function o(a){var s;Object.hasOwn(i,a)||(i[a]=!0,r[a]=!0,(s=e.outEdges(a))==null||s.forEach(i=>{Object.hasOwn(r,i.w)||t.node(a)?.rank>t.node(i.w)?.rank&&Ye(e,i.w,i)?n.push(i):o(i.w)}),delete r[a])}let s=a;return t&&typeof t.node==`function`&&(s=o),e.sources().forEach(s),e.nodes().forEach(s),n}function Je(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function Ye(e,t,n){let r=/* @__PURE__ */ new Set;function i(t){if(e.sources().includes(t))return!0;r.add(t);for(let a of e.inEdges(t)??[])if((a.v!==n.v||a.w!==n.w)&&!r.has(a.v)&&i(a.v))return!0;return!1}return i(t)}function Xe(e){e.graph().dummyChains=[],e.edges().forEach(t=>Ze(e,t))}function Ze(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=w(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function Qe(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function $e(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=E(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function j(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var et=tt;function tt(e){let t=new C({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;nt(t,e)<i&&(a=rt(t,e),a);)o=t.hasNode(a.v)?j(e,a):-j(e,a),it(t,e,o);return t}function nt(e,t){function n(r){let i=t.nodeEdges(r);i&&i.forEach(i=>{let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!j(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function rt(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=j(t,r)),i<n[0]?[i,r]:n},[1/0,null])[1]}function it(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}var{preorder:at,postorder:ot}=_,st=M;M.initLowLimValues=P,M.initCutValues=N,M.calcCutValue=lt,M.leaveEdge=dt,M.enterEdge=ft,M.exchangeEdges=pt;function M(e){e=be(e),$e(e);let t=et(e);P(t),N(t,e);let n,r;for(;n=dt(t);)r=ft(t,e,n),pt(t,e,n,r)}function N(e,t){let n=ot(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>ct(e,t,n))}function ct(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=lt(e,t,n)}function lt(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,ht(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function P(e,t){arguments.length<2&&(t=e.nodes()[0]),ut(e,{},1,t)}function ut(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=ut(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function dt(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function ft(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===gt(e,e.node(t.v),s)&&c!==gt(e,e.node(t.w),s)).reduce((e,n)=>j(t,n)<j(t,e)?n:e)}function pt(e,t,n,r){let i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),P(e),N(e,t),mt(e,t)}function mt(e,t){let n=e.nodes().find(t=>!e.node(t).parent);if(!n)return;let r=at(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function ht(e,t,n){return e.hasEdge(t,n)}function gt(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var _t=vt;function vt(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:xt(e);break;case`tight-tree`:bt(e);break;case`longest-path`:yt(e);break;case`none`:break;default:xt(e)}}var yt=$e;function bt(e){$e(e),et(e)}function xt(e){st(e)}var St=Ct;function Ct(e){let t=Tt(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=wt(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(o[c+1]).minRank<=r.rank;)c++;l=o[c]}l!==void 0&&e.setParent(n,l),n=e.successors(n)[0]}})}function wt(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function Tt(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(A).forEach(r),t}function Et(e){let t=w(e,`root`,{},`_root`),n=Ot(e),r=Object.values(n),i=E(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=kt(e)+1;e.children(A).forEach(r=>{Dt(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function Dt(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=Te(e,`_bt`),l=Te(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{Dt(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function Ot(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(A).forEach(e=>n(e,1)),t}function kt(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function At(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var jt=Mt;function Mt(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),i&&Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)Nt(e,`borderLeft`,`_bl`,n,i,t),Nt(e,`borderRight`,`_br`,n,i,t)}}e.children(A).forEach(t)}function Nt(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=w(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function Pt(e){let t=e.graph().rankdir?.toLowerCase();(t===`lr`||t===`rl`)&&It(e)}function Ft(e){let t=e.graph().rankdir?.toLowerCase();(t===`bt`||t===`rl`)&&Rt(e),(t===`lr`||t===`rl`)&&(zt(e),It(e))}function It(e){e.nodes().forEach(t=>Lt(e.node(t))),e.edges().forEach(t=>Lt(e.edge(t)))}function Lt(e){let t=e.width;e.width=e.height,e.height=t}function Rt(e){e.nodes().forEach(t=>F(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(F),Object.hasOwn(r,`y`)&&F(r)})}function F(e){e.y=-e.y}function zt(e){e.nodes().forEach(t=>I(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(I),Object.hasOwn(r,`x`)&&I(r)})}function I(e){let t=e.x;e.x=e.y,e.y=t}function Bt(e,t=null){let n={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=D(E(Math.max,i)+1).map(()=>[]);function o(t){if(n[t])return;n[t]=!0;let r=e.node(t);a[r.rank].push(t);let i=e.successors(t);i&&[...i].sort((e,t)=>s(e,t)).forEach(o)}r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(o);function s(n,r){return Pe(t,e.node(n),e.node(r))}return a}function Vt(e,t){let n=0;for(let r=1;r<t.length;++r)n+=Ht(e,t[r-1],t[r]);return n}function Ht(e,t,n){let r=Ne(n,n.map((e,t)=>t)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function Ut(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function Wt(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),Gt(Object.values(n).filter(e=>!e.indegree))}function Gt(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&Kt(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>O(e,[`vs`,`i`,`barycenter`,`weight`]))}function Kt(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function qt(e,t,n,r,i){let a={},o=null,s=null,c=i;typeof t==`boolean`?(c=t,a={}):t&&(a=t,o=n??null,s=r??null);let l=ke(e,e=>Object.hasOwn(e,`barycenter`)),u=l.lhs,d=l.rhs.sort((e,t)=>t.i-e.i),f=[],p=0,m=0,h=0;u.sort(Yt(s,o,!!c));for(let[e,t]of Object.entries(a)){let n=u.findIndex(t=>t.vs[0]===e);u.splice(n+1,0,t)}h=Jt(f,d,h),u.forEach(e=>{h+=e.vs.length,f.push(e.vs),p+=e.barycenter*e.weight,m+=e.weight,h=Jt(f,d,h)});let g={vs:f.flat(1)};return m&&(g.barycenter=p/m,g.weight=m),g}function Jt(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Yt(e,t,n){return(r,i)=>{if(r.barycenter<i.barycenter)return-1;if(r.barycenter>i.barycenter)return 1;if(e&&(typeof r.vs[0]==`string`||typeof i.vs[0]==`string`)){let n=Pe(t,e.node(r.vs[0]),e.node(i.vs[0]));if(n!==0)return n}return n?i.i-r.i:r.i-i.i}}function Xt(e,t,n,r,i){var a,o;let s=null,c=i;typeof r==`boolean`?(c=r,s=null):r!==void 0&&(s=r);let l=e.children(t),u=e.node(t),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};d&&(l=l.filter(e=>e!==d&&e!==f));let m=Ut(e,l);m.forEach(t=>{if(e.children(t.v).length){let{result:r}=Xt(e,t.v,n,s,c);p[t.v]=r,Object.hasOwn(r,`barycenter`)&&Qt(t,r)}});let h=Wt(m,n);Zt(h,p);let g={},_=!1;for(let t=0;t<h.length;t++)for(let n=t+1;n<h.length;n++)if(h[t]&&h[n]&&(a=h[t])!=null&&a.barycenter&&(o=h[n])!=null&&o.barycenter&&h[t]?.barycenter===h[n].barycenter){let r=h[t]?.vs[0]??``,i=h[n]?.vs[0]??``,a=e.node(r),o=e.node(i);if(a.dummy===`edge`&&o.dummy===`edge`&&a.edgeObj?.v===o.edgeObj?.v&&a.edgeObj?.w===o.edgeObj?.w){if(a.edgeLabel.reversed){g[i]=h[t],h.splice(t,1),t--;break}g[r]=h[n],h.splice(n,1),n--}else _=!0}let v=qt(h,g,s,e,c);if(d&&f){v.vs=[d,v.vs,f].flat(1);let t=e.predecessors(d);if(t&&t.length){let n=e.node(t[0]),r=e.predecessors(f),i=e.node(r[0]);Object.hasOwn(v,`barycenter`)||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+n.order+i.order)/(v.weight+2),v.weight+=2}}return Object.defineProperty(v,"result",{value:v,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(v,"usedBias",{value:_,enumerable:!1,configurable:!0,writable:!0}),v}function Zt(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function Qt(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function $t(e,t,n,r){r||=e.nodes();let i=en(e),a=new C({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function en(e){let t;for(;e.hasNode(t=Me(`_root`)););return t}function tn(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function nn(e,t={},n=null){if(typeof t.customOrder==`function`){t.customOrder(e,nn);return}let r=Oe(e),i=rn(e,D(1,r+1),`inEdges`),a=rn(e,D(r-1,-1,-1),`outEdges`),o=Bt(e,n);if(on(e,o),t.disableOptimalOrderHeuristic)return;let s=1/0,c,l=t.constraints||[];for(let t=0,r=0;r<4;++t,++r){an(t%2?i:a,t%4>=2,l,n),o=T(e);let u=Vt(e,o);u<s?(r=0,c=Object.assign({},o),s=u):u===s&&(c=structuredClone(o))}on(e,c)}function rn(e,t,n){let r=/* @__PURE__ */ new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return $t(e,t,n,r.get(t)||[])})}function an(e,t,n,r){let i=!0,a=new C;e.forEach(function(e){n.forEach(e=>a.setEdge(e.left,e.right));let o=e.graph().root,{result:s,usedBias:c}=Xt(e,o,a,r,i);t&&c&&(i=!i),s.vs.forEach((t,n)=>e.node(t).order=n),tn(e,a,s.vs)})}function on(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function sn(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=ln(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&un(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function cn(e,t){let n={};function r(t,r,i,a,o){D(r,i).forEach(r=>{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&un(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function ln(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function un(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function dn(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function fn(e,t,n,r,i){let a={},o={},s={};return t.forEach(e=>{e.forEach((e,t)=>{a[e]=e,o[e]=e,s[e]=t})}),t.forEach(t=>{let c=-1,l=-1,u=!1,d=t,f=t.findIndex(t=>i?.includes(t)||xn(t,e,i));f>0&&(d=[t[f],...t.slice(0,f),...t.slice(f+1)],u=!0),d.forEach(t=>{let d=r(t);if(d&&d.length){i!=null&&i.includes(t)&&(d=d.filter(t=>xn(t,e,i)));let r=d.sort((e,t)=>{let n=s[e],r=s[t];return(n===void 0?0:n)-(r===void 0?0:r)}),f=(r.length-1)/2;for(let e=Math.floor(f),i=Math.ceil(f);e<=i;++e){let i=r[e];if(i===void 0)continue;let d=s[i];if(d!==void 0&&o[t]===t&&c<d&&s[i]!==l&&!dn(n,t,i)){let e=a[i];e!==void 0&&(o[i]=t,o[t]=a[t]=e,c=d,u&&=(c=-1,l=s[i]??-1,!1))}}}})}),{root:a,align:o}}function pn(e,t,n,r,i=!1){let a={},o=mn(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){let t=o.inEdges(e);t?a[e]=t.reduce((e,t)=>{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function mn(e,t,n,r){let i=new C,a=e.graph(),o=yn(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function hn(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=bn(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function gn(e,t){let n=Object.values(t),r=E(Math.min,n),i=E(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-E(Math.min,c);a!==`l`&&(l=i-E(Math.max,c)),l&&(e[o]=k(s,e=>e+l))})})}function _n(e,t=void 0){let n=e.ul;return n?k(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function vn(e,t){let n=T(e),r=Object.assign(sn(e,n),cn(e,n)),i={},a;return[`u`,`d`].forEach(o=>{a=o===`u`?n:Object.values(n).reverse(),[`l`,`r`].forEach(n=>{n===`r`&&(a=a.map(e=>Object.values(e).reverse()));let s=fn(e,a,r,t=>(o===`u`?e.predecessors(t):e.successors(t))||[],t),c=pn(e,a,s.root,s.align,n===`r`);n===`r`&&(c=k(c,e=>-e)),i[o+n]=c})}),gn(i,hn(e,i)),_n(i,e.graph().align)}function yn(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),c}}function bn(e,t){return e.node(t).width}function xn(e,t,n){if(!n)return!1;let r=t.node(e)?.edgeObj;if(!r||t.node(e).edgeLabel.reversed)return!1;let i=n.indexOf(r?.v),a=n.indexOf(r?.w);return i!==-1&&a!==-1&&i===(a+1)%n.length||i===(a-1)%n.length}function Sn(e,t){e=xe(e),Cn(e),Object.entries(vn(e,t)).forEach(([t,n])=>e.node(t).x=n)}function Cn(e){let t=T(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}var wn=/* @__PURE__ */ new WeakMap;function Tn(e,t={}){return Dn(e,Ae,t),e}function En(e,t,n){let r=t;for(;r!==void 0;){let t=e.parent(r);if(t===n)return r;r=t}}function Dn(e,t,n){let r=e.nodes().filter(t=>e.children(t).length),i={};r.forEach(r=>{let a=e.node(r);if(a&&a.rankdir){let o=new C({multigraph:!0,compound:!0});o.setGraph({rankdir:a.rankdir});let s=e.children(r);s.forEach(t=>{let n={...e.node(t)};o.setNode(t,n);let i=e.parent(t);i&&i!==r&&s.includes(i)&&o.setParent(t,i)});let c=/* @__PURE__ */ new Set;e.edges().forEach(t=>{let n=En(e,t.v,r),i=En(e,t.w,r);if(n&&i&&n!==i){let r=`${n}\0${i}`;c.has(r)||(c.add(r),o.setEdge(n,i,{...e.edge(t)}))}}),Dn(o,t,n);let l=Rn(o);On(l,t,n,null),kn(o,l);let u=1/0,d=1/0,f=-1/0,p=-1/0;o.nodes().forEach(e=>{if(e===r)return;let t=o.node(e);t&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.width==`number`&&typeof t.height==`number`&&(u=Math.min(u,t.x-t.width/2),f=Math.max(f,t.x+t.width/2),d=Math.min(d,t.y-t.height/2),p=Math.max(p,t.y+t.height/2))}),(!isFinite(u)||!isFinite(d)||!isFinite(f)||!isFinite(p))&&(u=d=0,f=p=0);let m=f-u,h=p-d;i[r]={minX:u,minY:d,maxX:f,maxY:p,width:m,height:h,offsetX:u,offsetY:d},a._dagreClusterSubgraph=o}});let a=[],o=t=>{let n=[],r=(e.children(t)||[]).filter(e=>e!==t);for(;r.length>0;){let t=r.shift();n.push(t),(e.children(t)||[]).filter(e=>e!==t).forEach(e=>r.push(e))}return n},s=/* @__PURE__ */ new Map;r.forEach(t=>{let n=e.node(t);n&&n.rankdir&&i[t]&&s.set(t,(e.children(t)||[]).filter(e=>e!==t))});let c=new Set([...s.values()].flat()),l=/* @__PURE__ */ new Map;s.forEach((e,t)=>{c.has(t)||l.set(t,o(t))});let u=new Set([...l.values()].flat()),d=e=>{for(let[t,n]of l)if(n.includes(e))return t;return e},f=[];e.edges().forEach(t=>{(u.has(t.v)||u.has(t.w))&&f.push({edge:t,label:e.edge(t)})});let p=/* @__PURE__ */ new Map;u.forEach(t=>{let n=e.parent(t);p.set(t,typeof n==`string`?n:void 0)}),l.forEach((t,n)=>{let r=e.node(n),o=[];t.forEach(t=>{let n=e.node(t);n&&(o.push({id:t,node:n,parent:p.get(t)}),e.removeNode(t))});let s=f.filter(({edge:e})=>t.includes(e.v)||t.includes(e.w)),c=i[n];r&&(a.push({clusterId:n,subgraph:r._dagreClusterSubgraph,bounds:c,children:t,removedNodes:o,removedEdges:s}),r.width=c.width,r.height=c.height)});let m=/* @__PURE__ */ new Set;f.forEach(({edge:t,label:n})=>{let r=d(t.v),i=d(t.w);if(r!==i&&e.hasNode(r)&&e.hasNode(i)){let t=`${r}\0${i}`;m.has(t)||(m.add(t),e.setEdge(r,i,{...n,width:0,height:0}))}});let h=Rn(e),g=On(h,t,n,wn.get(e)??null);wn.set(e,g),kn(e,h),m.forEach(t=>{let n=t.indexOf(`\0`),r=t.slice(0,n),i=t.slice(n+1);e.hasEdge(r,i)&&e.removeEdge(r,i)}),a.forEach(({clusterId:t,subgraph:n,bounds:r,removedNodes:i,removedEdges:a})=>{let o=e.node(t),s=o?.x??0,c=o?.y??0,l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2;i.forEach(({id:t,node:n,parent:r})=>{e.setNode(t,n),r!==void 0&&e.setParent(t,r)}),a.forEach(({edge:t,label:n})=>{e.setEdge(t,n)}),n.nodes().forEach(r=>{if(r===t)return;let i=n.node(r),a=e.node(r);a&&i&&typeof i.x==`number`&&typeof i.y==`number`&&(a.x=s+(i.x-l),a.y=c+(i.y-u))}),delete o._dagreClusterSubgraph}),r.forEach(t=>{let n=e.node(t),r=i[t];if(n&&n.rankdir&&n._dagreClusterSubgraph&&r){let i=n._dagreClusterSubgraph,a=n.x??0,o=n.y??0,s=(r.minX+r.maxX)/2,c=(r.minY+r.maxY)/2;i.nodes().forEach(n=>{if(n===t)return;let r=i.node(n),l=e.node(n);if(l&&r&&typeof r.x==`number`&&typeof r.y==`number`){let e=r.x-s,t=r.y-c;l.x=a+e,l.y=o+t}}),delete n._dagreClusterSubgraph}})}function On(e,t,n,r=null){var i,a;let o=n?.useDynamic!==!1,s=o&&(i=r?.graph)!=null?i:null,c=o&&(a=r?.rawNodes)!=null?a:null;t(` makeSpaceForEdgeLabels`,()=>zn(e)),t(` removeSelfEdges`,()=>Jn(e)),t(` acyclic`,()=>Ke(e,s)),t(` nestingGraph.run`,()=>Et(e)),t(` rank`,()=>_t(xe(e))),t(` injectEdgeLabelProxies`,()=>Bn(e)),t(` removeEmptyRanks`,()=>we(e)),t(` nestingGraph.cleanup`,()=>At(e)),t(` normalizeRanks`,()=>Ce(e)),t(` assignRankMinMax`,()=>Vn(e)),t(` removeEdgeLabelProxies`,()=>Hn(e)),t(` normalize.run`,()=>Xe(e)),t(` parentDummyChains`,()=>St(e)),t(` addBorderSegments`,()=>jt(e)),t(` order`,()=>nn(e,n,c)),t(` insertSelfEdges`,()=>Yn(e)),t(` adjustCoordinateSystem`,()=>Pt(e)),t(` position`,()=>Sn(e,n.corePath)),t(` positionSelfEdges`,()=>Xn(e));let l=JSON.parse(JSON.stringify(e._nodes));return t(` removeBorderNodes`,()=>qn(e)),t(` normalize.undo`,()=>Qe(e)),t(` fixupEdgeLabelCoords`,()=>Gn(e)),t(` undoCoordinateSystem`,()=>Ft(e)),t(` translateGraph`,()=>Un(e)),t(` assignNodeIntersects`,()=>Wn(e)),t(` reversePoints`,()=>Kn(e)),t(` acyclic.undo`,()=>Je(e)),{graph:e,rawNodes:l}}function kn(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var An=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],jn={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},Mn=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],Nn=[`width`,`height`,`rank`],Pn={width:0,height:0},Fn=[`minlen`,`weight`,`width`,`height`,`labeloffset`],In={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Ln=[`labelpos`];function Rn(e){let t=new C({multigraph:!0,compound:!0}),n=R(e.graph());return t.setGraph(Object.assign({},jn,L(n,An),O(n,Mn))),e.nodes().forEach(n=>{let r=L(R(e.node(n)),Nn);Object.keys(Pn).forEach(e=>{r[e]===void 0&&(r[e]=Pn[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=R(e.edge(n));t.setEdge(n,Object.assign({},In,L(r,Fn),O(r,Ln)))}),t}function zn(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,(r.labelpos??`r`).toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Bn(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);w(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function Vn(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function Hn(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function Un(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function Wn(e){e.edges().forEach(t=>{if(t.v===t.w)return;let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(Se(r,a)),n.points.push(Se(i,o))})}function Gn(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function Kn(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function qn(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function Jn(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Yn(e){T(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);typeof i.rank!=`number`&&(i.rank=0),i.order=r+n,(i.selfEdges||[]).forEach(t=>{w(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,edgeLabel:t.label},`_se`),(!Array.isArray(t.label.points)||t.label.points.length!==7)&&(t.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete i.selfEdges})})}function Xn(e){e.nodes().forEach(t=>{let n=e.node(t),r=e=>typeof e==`number`&&isFinite(e);if(n.dummy===`selfedge`){let i=n,a=e.node(i.e.v),o=r(a?.x)?a.x:0,s=r(a?.y)?a.y:0,c=r(a?.width)?a.width:0,l=r(a?.height)?a.height:0,u=r(n.x)?n.x:o,d=r(n.y)?n.y:s,f=c/2,p=l/2;i.edgeLabel.points=[{x:u+f,y:d-p},{x:u+f,y:d-p},{x:u,y:d},{x:u-f,y:d+p},{x:u-f,y:d+p},{x:u,y:d},{x:u,y:d}],i.edgeLabel.x=u,i.edgeLabel.y=d,e.setEdge(i.e,i.edgeLabel),e.removeNode(t)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(e=>{if(!Array.isArray(e.label.points)||e.label.points.length!==7){let t=r(n.x)?n.x:0,i=r(n.y)?n.y:0,a=r(n.width)?n.width:0,o=r(n.height)?n.height:0,s=a/2,c=o/2;e.label.points=[{x:t+s,y:i-c},{x:t+s,y:i-c},{x:t,y:i},{x:t-s,y:i+c},{x:t-s,y:i+c},{x:t,y:i},{x:t,y:i}]}})})}function L(e,t){return k(O(e,t),Number)}function R(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}
|
|
2
|
+
/*! For license information please see dagre.esm.js.LEGAL.txt */
|
|
3
|
+
function Zn(e,t){var n,r=1;e??=0,t??=0;function i(){var i,a=n.length,o,s=0,c=0;for(i=0;i<a;++i)o=n[i],s+=o.x,c+=o.y;for(s=(s/a-e)*r,c=(c/a-t)*r,i=0;i<a;++i)o=n[i],o.x-=s,o.y-=c}return i.initialize=function(e){n=e},i.x=function(t){return arguments.length?(e=+t,i):e},i.y=function(e){return arguments.length?(t=+e,i):t},i.strength=function(e){return arguments.length?(r=+e,i):r},i}function Qn(e){let t=+this._x.call(null,e),n=+this._y.call(null,e);return $n(this.cover(t,n),t,n,e)}function $n(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,a=e._root,o={data:r},s=e._x0,c=e._y0,l=e._x1,u=e._y1,d,f,p,m,h,g,_,v;if(!a)return e._root=o,e;for(;a.length;)if((h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f,i=a,!(a=a[_=g<<1|h]))return i[_]=o,e;if(p=+e._x.call(null,a.data),m=+e._y.call(null,a.data),t===p&&n===m)return o.next=a,i?i[_]=o:e._root=o,e;do i=i?i[_]=[,,,,]:e._root=[,,,,],(h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f;while((_=g<<1|h)==(v=(m>=f)<<1|p>=d));return i[v]=a,i[_]=o,e}function er(e){var t,n,r=e.length,i,a,o=Array(r),s=Array(r),c=1/0,l=1/0,u=-1/0,d=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(a=+this._y.call(null,t))||(o[n]=i,s[n]=a,i<c&&(c=i),i>u&&(u=i),a<l&&(l=a),a>d&&(d=a));if(c>u||l>d)return this;for(this.cover(c,l).cover(u,d),n=0;n<r;++n)$n(this,o[n],s[n],e[n]);return this}function tr(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,a=(r=Math.floor(t))+1;else{for(var o=i-n||1,s=this._root,c,l;n>e||e>=i||r>t||t>=a;)switch(l=(t<r)<<1|e<n,c=[,,,,],c[l]=s,s=c,o*=2,l){case 0:i=n+o,a=r+o;break;case 1:n=i-o,a=r+o;break;case 2:i=n+o,r=a-o;break;case 3:n=i-o,r=a-o}this._root&&this._root.length&&(this._root=s)}return this._x0=n,this._y0=r,this._x1=i,this._y1=a,this}function nr(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function rr(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function z(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function ir(e,t,n){var r,i=this._x0,a=this._y0,o,s,c,l,u=this._x1,d=this._y1,f=[],p=this._root,m,h;for(p&&f.push(new z(p,i,a,u,d)),n==null?n=1/0:(i=e-n,a=t-n,u=e+n,d=t+n,n*=n);m=f.pop();)if(!(!(p=m.node)||(o=m.x0)>u||(s=m.y0)>d||(c=m.x1)<i||(l=m.y1)<a)){if(p.length){var g=(o+c)/2,_=(s+l)/2;f.push(new z(p[3],g,_,c,l),new z(p[2],o,_,g,l),new z(p[1],g,s,c,_),new z(p[0],o,s,g,_)),(h=(t>=_)<<1|e>=g)&&(m=f[f.length-1],f[f.length-1]=f[f.length-1-h],f[f.length-1-h]=m)}else{var v=e-+this._x.call(null,p.data),y=t-+this._y.call(null,p.data),ee=v*v+y*y;if(ee<n){var b=Math.sqrt(n=ee);i=e-b,a=t-b,u=e+b,d=t+b,r=p.data}}}return r}function ar(e){if(isNaN(u=+this._x.call(null,e))||isNaN(d=+this._y.call(null,e)))return this;var t,n=this._root,r,i,a,o=this._x0,s=this._y0,c=this._x1,l=this._y1,u,d,f,p,m,h,g,_;if(!n)return this;if(n.length)for(;;){if((m=u>=(f=(o+c)/2))?o=f:c=f,(h=d>=(p=(s+l)/2))?s=p:l=p,t=n,!(n=n[g=h<<1|m]))return this;if(!n.length)break;(t[g+1&3]||t[g+2&3]||t[g+3&3])&&(r=t,_=g)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,i?(a?i.next=a:delete i.next,this):t?(a?t[g]=a:delete t[g],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[_]=n:this._root=n),this):(this._root=a,this)}function or(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function sr(){return this._root}function cr(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function lr(e){var t=[],n,r=this._root,i,a,o,s,c;for(r&&t.push(new z(r,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(r=n.node,a=n.x0,o=n.y0,s=n.x1,c=n.y1)&&r.length){var l=(a+s)/2,u=(o+c)/2;(i=r[3])&&t.push(new z(i,l,u,s,c)),(i=r[2])&&t.push(new z(i,a,u,l,c)),(i=r[1])&&t.push(new z(i,l,o,s,u)),(i=r[0])&&t.push(new z(i,a,o,l,u))}return this}function ur(e){var t=[],n=[],r;for(this._root&&t.push(new z(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var i=r.node;if(i.length){var a,o=r.x0,s=r.y0,c=r.x1,l=r.y1,u=(o+c)/2,d=(s+l)/2;(a=i[0])&&t.push(new z(a,o,s,u,d)),(a=i[1])&&t.push(new z(a,u,s,c,d)),(a=i[2])&&t.push(new z(a,o,d,u,l)),(a=i[3])&&t.push(new z(a,u,d,c,l))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function dr(e){return e[0]}function fr(e){return arguments.length?(this._x=e,this):this._x}function pr(e){return e[1]}function mr(e){return arguments.length?(this._y=e,this):this._y}function hr(e,t,n){var r=new gr(t??dr,n??pr,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function gr(e,t,n,r,i,a){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function _r(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var B=hr.prototype=gr.prototype;B.copy=function(){var e=new gr(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,r;if(!t)return e;if(!t.length)return e._root=_r(t),e;for(n=[{source:t,target:e._root=[,,,,]}];t=n.pop();)for(var i=0;i<4;++i)(r=t.source[i])&&(r.length?n.push({source:r,target:t.target[i]=[,,,,]}):t.target[i]=_r(r));return e},B.add=Qn,B.addAll=er,B.cover=tr,B.data=nr,B.extent=rr,B.find=ir,B.remove=ar,B.removeAll=or,B.root=sr,B.size=cr,B.visit=lr,B.visitAfter=ur,B.x=fr,B.y=mr;function V(e){return function(){return e}}function H(e){return(e()-.5)*1e-6}function vr(e){return e.x+e.vx}function yr(e){return e.y+e.vy}function br(e){var t,n,r,i=1,a=1;typeof e!=`function`&&(e=V(e==null?1:+e));function o(){for(var e,o=t.length,c,l,u,d,f,p,m=0;m<a;++m)for(c=hr(t,vr,yr).visitAfter(s),e=0;e<o;++e)l=t[e],f=n[l.index],p=f*f,u=l.x+l.vx,d=l.y+l.vy,c.visit(h);function h(e,t,n,a,o){var s=e.data,c=e.r,m=f+c;if(s){if(s.index>l.index){var h=u-s.x-s.vx,g=d-s.y-s.vy,_=h*h+g*g;_<m*m&&(h===0&&(h=H(r),_+=h*h),g===0&&(g=H(r),_+=g*g),_=(m-(_=Math.sqrt(_)))/_*i,l.vx+=(h*=_)*(m=(c*=c)/(p+c)),l.vy+=(g*=_)*m,s.vx-=h*(m=1-m),s.vy-=g*m)}}else return t>u+m||a<u-m||n>d+m||o<d-m}}function s(e){if(e.data)return e.r=n[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function c(){if(t){var r,i=t.length,a;for(n=Array(i),r=0;r<i;++r)a=t[r],n[a.index]=+e(a,r,t)}}return o.initialize=function(e,n){t=e,r=n,c()},o.iterations=function(e){return arguments.length?(a=+e,o):a},o.strength=function(e){return arguments.length?(i=+e,o):i},o.radius=function(t){return arguments.length?(e=typeof t==`function`?t:V(+t),c(),o):e},o}function xr(e){return e.index}function Sr(e,t){var n=e.get(t);if(!n)throw Error(`node not found: `+t);return n}function Cr(e){var t=xr,n=d,r,i=V(30),a,o,s,c,l,u=1;e??=[];function d(e){return 1/Math.min(s[e.source.index],s[e.target.index])}function f(t){for(var n=0,i=e.length;n<u;++n)for(var o=0,s,d,f,p,m,h,g;o<i;++o)s=e[o],d=s.source,f=s.target,p=f.x+f.vx-d.x-d.vx||H(l),m=f.y+f.vy-d.y-d.vy||H(l),h=Math.sqrt(p*p+m*m),h=(h-a[o])/h*t*r[o],p*=h,m*=h,f.vx-=p*(g=c[o]),f.vy-=m*g,d.vx+=p*(g=1-g),d.vy+=m*g}function p(){if(o){var n,i=o.length,l=e.length,u=new Map(o.map((e,n)=>[t(e,n,o),e])),d;for(n=0,s=Array(i);n<l;++n)d=e[n],d.index=n,typeof d.source!=`object`&&(d.source=Sr(u,d.source)),typeof d.target!=`object`&&(d.target=Sr(u,d.target)),s[d.source.index]=(s[d.source.index]||0)+1,s[d.target.index]=(s[d.target.index]||0)+1;for(n=0,c=Array(l);n<l;++n)d=e[n],c[n]=s[d.source.index]/(s[d.source.index]+s[d.target.index]);r=Array(l),m(),a=Array(l),h()}}function m(){if(o)for(var t=0,i=e.length;t<i;++t)r[t]=+n(e[t],t,e)}function h(){if(o)for(var t=0,n=e.length;t<n;++t)a[t]=+i(e[t],t,e)}return f.initialize=function(e,t){o=e,l=t,p()},f.links=function(t){return arguments.length?(e=t,p(),f):e},f.id=function(e){return arguments.length?(t=e,f):t},f.iterations=function(e){return arguments.length?(u=+e,f):u},f.strength=function(e){return arguments.length?(n=typeof e==`function`?e:V(+e),m(),f):n},f.distance=function(e){return arguments.length?(i=typeof e==`function`?e:V(+e),h(),f):i},f}var wr={value:()=>{}};function Tr(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new U(n)}function U(e){this._=e}function Er(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}U.prototype=Tr.prototype={constructor:U,on:function(e,t){var n=this._,r=Er(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Dr(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=Or(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Or(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new U(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Dr(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Or(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=wr,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var W=0,G=0,kr=0,Ar=1e3,K,q,J=0,Y=0,X=0,Z=typeof performance==`object`&&performance.now?performance:Date,jr=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Mr(){return Y||=(jr(Nr),Z.now()+X)}function Nr(){Y=0}function Q(){this._call=this._time=this._next=null}Q.prototype=Pr.prototype={constructor:Q,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Mr():+n)+(t==null?0:+t),!this._next&&q!==this&&(q?q._next=this:K=this,q=this),this._call=e,this._time=n,$()},stop:function(){this._call&&(this._call=null,this._time=1/0,$())}};function Pr(e,t,n){var r=new Q;return r.restart(e,t,n),r}function Fr(){Mr(),++W;for(var e=K,t;e;)(t=Y-e._time)>=0&&e._call.call(void 0,t),e=e._next;--W}function Ir(){Y=(J=Z.now())+X,W=G=0;try{Fr()}finally{W=0,Rr(),Y=0}}function Lr(){var e=Z.now(),t=e-J;t>Ar&&(X-=t,J=e)}function Rr(){for(var e,t=K,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:K=n);q=e,$(r)}function $(e){W||(G&&=clearTimeout(G),e-Y>24?(e<1/0&&(G=setTimeout(Ir,e-Z.now()-X)),kr&&=clearInterval(kr)):(kr||=(J=Z.now(),setInterval(Lr,Ar)),W=1,jr(Ir)))}const zr=4294967296;function Br(){let e=1;return()=>(e=(1664525*e+1013904223)%zr)/zr}function Vr(e){return e.x}function Hr(e){return e.y}var Ur=10,Wr=Math.PI*(3-Math.sqrt(5));function Gr(e){var t,n=1,r=.001,i=1-r**(1/300),a=0,o=.6,s=/* @__PURE__ */ new Map,c=Pr(d),l=Tr(`tick`,`end`),u=Br();e??=[];function d(){f(),l.call(`tick`,t),n<r&&(c.stop(),l.call(`end`,t))}function f(r){var c,l=e.length,u;r===void 0&&(r=1);for(var d=0;d<r;++d)for(n+=(a-n)*i,s.forEach(function(e){e(n)}),c=0;c<l;++c)u=e[c],u.fx==null?u.x+=u.vx*=o:(u.x=u.fx,u.vx=0),u.fy==null?u.y+=u.vy*=o:(u.y=u.fy,u.vy=0);return t}function p(){for(var t=0,n=e.length,r;t<n;++t){if(r=e[t],r.index=t,r.fx!=null&&(r.x=r.fx),r.fy!=null&&(r.y=r.fy),isNaN(r.x)||isNaN(r.y)){var i=Ur*Math.sqrt(.5+t),a=t*Wr;r.x=i*Math.cos(a),r.y=i*Math.sin(a)}(isNaN(r.vx)||isNaN(r.vy))&&(r.vx=r.vy=0)}}function m(t){return t.initialize&&t.initialize(e,u),t}return p(),t={tick:f,restart:function(){return c.restart(d),t},stop:function(){return c.stop(),t},nodes:function(n){return arguments.length?(e=n,p(),s.forEach(m),t):e},alpha:function(e){return arguments.length?(n=+e,t):n},alphaMin:function(e){return arguments.length?(r=+e,t):r},alphaDecay:function(e){return arguments.length?(i=+e,t):+i},alphaTarget:function(e){return arguments.length?(a=+e,t):a},velocityDecay:function(e){return arguments.length?(o=1-e,t):1-o},randomSource:function(e){return arguments.length?(u=e,s.forEach(m),t):u},force:function(e,n){return arguments.length>1?(n==null?s.delete(e):s.set(e,m(n)),t):s.get(e)},find:function(t,n,r){var i=0,a=e.length,o,s,c,l,u;for(r==null?r=1/0:r*=r,i=0;i<a;++i)l=e[i],o=t-l.x,s=n-l.y,c=o*o+s*s,c<r&&(u=l,r=c);return u},on:function(e,n){return arguments.length>1?(l.on(e,n),t):l.on(e)}}}function Kr(){var e,t,n,r,i=V(-30),a,o=1,s=1/0,c=.81;function l(n){var i,a=e.length,o=hr(e,Vr,Hr).visitAfter(d);for(r=n,i=0;i<a;++i)t=e[i],o.visit(f)}function u(){if(e){var t,n=e.length,r;for(a=Array(n),t=0;t<n;++t)r=e[t],a[r.index]=+i(r,t,e)}}function d(e){var t=0,n,r,i=0,o,s,c;if(e.length){for(o=s=c=0;c<4;++c)(n=e[c])&&(r=Math.abs(n.value))&&(t+=n.value,i+=r,o+=r*n.x,s+=r*n.y);e.x=o/i,e.y=s/i}else{n=e,n.x=n.data.x,n.y=n.data.y;do t+=a[n.data.index];while(n=n.next)}e.value=t}function f(e,i,l,u){if(!e.value)return!0;var d=e.x-t.x,f=e.y-t.y,p=u-i,m=d*d+f*f;if(p*p/c<m)return m<s&&(d===0&&(d=H(n),m+=d*d),f===0&&(f=H(n),m+=f*f),m<o&&(m=Math.sqrt(o*m)),t.vx+=d*e.value*r/m,t.vy+=f*e.value*r/m),!0;if(!(e.length||m>=s)){(e.data!==t||e.next)&&(d===0&&(d=H(n),m+=d*d),f===0&&(f=H(n),m+=f*f),m<o&&(m=Math.sqrt(o*m)));do e.data!==t&&(p=a[e.data.index]*r/m,t.vx+=d*p,t.vy+=f*p);while(e=e.next)}}return l.initialize=function(t,r){e=t,n=r,u()},l.strength=function(e){return arguments.length?(i=typeof e==`function`?e:V(+e),u(),l):i},l.distanceMin=function(e){return arguments.length?(o=e*e,l):Math.sqrt(o)},l.distanceMax=function(e){return arguments.length?(s=e*e,l):Math.sqrt(s)},l.theta=function(e){return arguments.length?(c=e*e,l):Math.sqrt(c)},l}function qr(e){var t=V(.1),n,r,i;typeof e!=`function`&&(e=V(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t<a;++t)o=n[t],o.vx+=(i[t]-o.x)*r[t]*e}function o(){if(n){var a,o=n.length;for(r=Array(o),i=Array(o),a=0;a<o;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return a.initialize=function(e){n=e,o()},a.strength=function(e){return arguments.length?(t=typeof e==`function`?e:V(+e),o(),a):t},a.x=function(t){return arguments.length?(e=typeof t==`function`?t:V(+t),o(),a):e},a}function Jr(e){var t=V(.1),n,r,i;typeof e!=`function`&&(e=V(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t<a;++t)o=n[t],o.vy+=(i[t]-o.y)*r[t]*e}function o(){if(n){var a,o=n.length;for(r=Array(o),i=Array(o),a=0;a<o;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return a.initialize=function(e){n=e,o()},a.strength=function(e){return arguments.length?(t=typeof e==`function`?e:V(+e),o(),a):t},a.y=function(t){return arguments.length?(e=typeof t==`function`?t:V(+t),o(),a):e},a}function Yr(e,t){let n=new i.Graph({multigraph:!0});n.setGraph({rankdir:t,nodesep:32,ranksep:72,edgesep:16}),n.setDefaultEdgeLabel(()=>({}));for(let t of e.nodes)n.setNode(t.id,{width:t.width,height:t.height});e.edges.forEach((e,t)=>n.setEdge(e.from,e.to,{},`e${t}`)),Tn(n);let r={};for(let t of e.nodes){let{x:e=0,y:i=0}=n.node(t.id);r[t.id]={x:e,y:i}}return{positions:r,routes:e.edges.map((e,t)=>(n.edge(e.from,e.to,`e${t}`).points??[]).map(({x:e,y:t})=>({x:e,y:t})))}}function Xr(e){let{previous:t}=e,n=new Map(e.nodes.map(e=>[e.id,[]]));for(let t of e.edges)n.get(t.from)?.push(t.to),n.get(t.to)?.push(t.from);let r=e.nodes.map((e,r)=>{let i=t?.[e.id];if(i)return{id:e.id,x:i.x,y:i.y,fx:i.x,fy:i.y};let a=t&&n.get(e.id)?.find(e=>t[e]);if(a){let n=r*2.4;return{id:e.id,x:t[a].x+120*Math.cos(n),y:t[a].y+120*Math.sin(n)}}return{id:e.id}}),i=Math.max(0,...e.nodes.map(e=>Math.hypot(e.width,e.height)/2)),a=e.edges.map(e=>({source:e.from,target:e.to})),o=Gr(r).force(`link`,Cr(a).id(e=>e.id).distance(170)).force(`charge`,Kr().strength(-900)).force(`collide`,br(i+16)).force(`x`,qr(0).strength(.02)).force(`y`,Jr(0).strength(.02)).stop();t||o.force(`center`,Zn(0,0)),o.tick(300);let s={};for(let e of r)s[e.id]={x:e.x??0,y:e.y??0};return{positions:s}}function Zr(e){let t=e.nodes.map(e=>e.id),n=e.centre&&t.includes(e.centre)?e.centre:t[0],r={};if(!n)return{positions:r};let i=new Map(t.map(e=>[e,[]]));for(let t of e.edges)i.get(t.from)?.push(t.to),i.get(t.to)?.push(t.from);let a=/* @__PURE__ */ new Map([[n,0]]),o=/* @__PURE__ */ new Map,s=[n];for(let e=0;e<s.length;e++){let t=s[e];for(let e of i.get(t)??[])a.has(e)||(a.set(e,a.get(t)+1),o.set(e,t),s.push(e))}for(let e of t)a.has(e)||(a.set(e,1),o.set(e,n),s.push(e));let c=[];for(let e of s)(c[a.get(e)]??=[]).push(e);let l=/* @__PURE__ */ new Map([[n,0]]);r[n]={x:0,y:0};let u=0;for(let e=1;e<c.length;e++){let t=c[e]??[],n=t.length;if(n){if(u=Math.max(u+200,n*96/Math.PI),e===1)t.forEach((e,t)=>l.set(e,-Math.PI/2+t*2*Math.PI/n));else{let e=/* @__PURE__ */ new Map;for(let n of t){let t=o.get(n);e.set(t,[...e.get(t)??[],n])}let r=[...e.keys()].sort((e,t)=>l.get(e)-l.get(t)),i=r.flatMap(t=>e.get(t)),a=Math.min(2*Math.PI/n,240/u),s=e.get(r[0]).length,c=l.get(r[0])-(s-1)/2*a;i.forEach((e,t)=>l.set(e,c+t*a))}for(let e of t){let t=l.get(e);r[e]={x:u*1.3*Math.cos(t),y:u*Math.sin(t)}}}}return{positions:r}}function Qr(e){switch(e.kind){case`layered-right`:return Yr(e,`LR`);case`layered-down`:return Yr(e,`TB`);case`radial`:return Zr(e);default:return Xr(e)}}const $r=self;$r.addEventListener(`message`,e=>{let{id:t,request:n}=e.data;$r.postMessage({id:t,result:Qr(n)},[])});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M20.41 10.61L20.69 10.16L20.90 9.68L21.05 9.17L21.10 8.82L21.12 8.46L21.08 7.94L20.96 7.42L20.77 6.93L20.51 6.46L20.18 6.05L19.80 5.68L19.52 5.47L19.21 5.29L18.73 5.07L18.22 4.93L17.69 4.87L17.16 4.88L16.64 4.97L16.14 5.14L15.82 5.29L15.52 5.47L15.23 5.68L14.97 5.92L12.87 8.02L13.19 8.26L13.50 8.55L13.78 8.86L14.11 9.33L16.24 7.19L16.52 6.97L16.91 6.77L17.25 6.68L17.60 6.67L17.95 6.72L18.36 6.88L18.72 7.13L19.01 7.46L19.14 7.69L19.24 7.94L19.31 8.38L19.28 8.82L19.14 9.23L18.91 9.61L14.76 13.76L14.56 13.92L14.33 14.05L14.08 14.15L13.73 14.22L13.29 14.20L13.03 14.15L12.79 14.05L12.56 13.92L12.35 13.76L12.16 13.57L12.01 13.34L11.67 13.28L11.49 13.19L11.39 13.10L11.25 12.87L11.21 12.60L11.24 12.40L11.44 12.05L11.52 11.79L11.54 11.47L11.48 11.21L11.33 10.92L11.10 10.69L10.81 10.54L10.53 10.48L10.30 10.89L10.17 11.21L10.06 11.55L9.99 11.90L9.96 12.25L9.96 12.60L9.99 12.95L10.06 13.30L10.17 13.64L10.30 13.96L10.47 14.28L10.66 14.57L10.89 14.84L11.14 15.09L11.41 15.32L11.70 15.51L12.02 15.68L12.34 15.81L12.68 15.92L13.03 15.99L13.38 16.02L13.73 16.02L14.08 15.99L14.43 15.92L14.77 15.81L15.25 15.60L15.70 15.32L15.97 15.09L20.06 11.01ZM13.62 13.27L13.83 12.79L13.98 12.28L14.04 11.75L14.03 11.22L13.94 10.70L13.77 10.20L13.53 9.72L13.23 9.29L12.86 8.91L12.44 8.58L11.98 8.32L11.49 8.13L10.97 8.01L10.44 7.98L9.92 8.01L9.40 8.13L9.07 8.25L8.59 8.49L8.30 8.68L8.03 8.91L3.94 12.99L3.59 13.39L3.40 13.68L3.16 14.16L2.99 14.66L2.92 15.01L2.89 15.36L2.89 15.71L2.92 16.06L3.04 16.58L3.23 17.07L3.40 17.39L3.70 17.82L4.07 18.20L4.34 18.43L4.79 18.71L5.27 18.93L5.61 19.03L6.13 19.12L6.48 19.14L6.84 19.12L7.36 19.03L7.86 18.86L8.34 18.62L8.63 18.43L9.03 18.08L11.13 15.98L10.81 15.74L10.50 15.45L10.22 15.14L9.89 14.67L7.63 16.93L7.41 17.08L7.17 17.20L6.75 17.32L6.40 17.33L5.96 17.26L5.56 17.08L5.28 16.87L5.04 16.61L4.82 16.22L4.70 15.80L4.69 15.36L4.74 15.10L4.82 14.85L4.94 14.61L5.15 14.33L9.24 10.24L9.60 9.99L9.92 9.85L10.18 9.80L10.44 9.78L10.80 9.81L11.05 9.88L11.37 10.03L11.59 10.18L11.84 10.43L11.99 10.66L12.33 10.72L12.56 10.86L12.69 11.01L12.75 11.13L12.79 11.40L12.76 11.60L12.56 11.95L12.48 12.21L12.46 12.53L12.54 12.85L12.64 13.04L12.78 13.20L12.94 13.34L13.13 13.44L13.47 13.52Z" fill-rule="evenodd"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2.9 5h18.2a.9.9 0 0 1 .9.9v12.2a.9.9 0 0 1-.9.9H2.9a.9.9 0 0 1-.9-.9V5.9a.9.9 0 0 1 .9-.9Zm.7 1.6v10.8h16.8V6.6ZM6.8 11h8.4a.8.8 0 0 1 0 1.6H6.8a.8.8 0 0 1 0-1.6Zm0 3h2.8a.8.8 0 0 1 0 1.6H6.8a.8.8 0 0 1 0-1.6Zm6 0h4.4a.8.8 0 0 1 0 1.6h-4.4a.8.8 0 0 1 0-1.6Z" fill-rule="evenodd"/></svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lintje",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Lintje: the Rijkshuisstijl design system as Lit web components",
|
|
6
6
|
"license": "EUPL-1.2",
|
|
@@ -75,6 +75,10 @@
|
|
|
75
75
|
"types": "./dist-elements/map.d.ts",
|
|
76
76
|
"default": "./dist-elements/map.js"
|
|
77
77
|
},
|
|
78
|
+
"./graph": {
|
|
79
|
+
"types": "./dist-elements/graph.d.ts",
|
|
80
|
+
"default": "./dist-elements/graph.js"
|
|
81
|
+
},
|
|
78
82
|
"./tables": {
|
|
79
83
|
"types": "./dist-elements/tables.d.ts",
|
|
80
84
|
"default": "./dist-elements/tables.js"
|
|
@@ -120,10 +124,13 @@
|
|
|
120
124
|
}
|
|
121
125
|
},
|
|
122
126
|
"devDependencies": {
|
|
127
|
+
"@dagrejs/dagre": "3.1.1",
|
|
123
128
|
"@nl-rvo/assets": "1.2.1",
|
|
129
|
+
"@types/d3-force": "^3.0.10",
|
|
124
130
|
"@types/leaflet": "^1.9.22",
|
|
125
131
|
"@vitest/browser-playwright": "^5.0.3",
|
|
126
132
|
"axe-core": "^4.14.0",
|
|
133
|
+
"d3-force": "3.0.0",
|
|
127
134
|
"happy-dom": "^20.14.6",
|
|
128
135
|
"leaflet": "1.9.4",
|
|
129
136
|
"lit": "3.3.3",
|